« Back to channel list

#RubyOnRails - 25 May 2017

« Back 1 day Forward 1 day »
[00:01:13] Matrix9180: has joined #RubyOnRails
[00:01:47] rakm: has joined #RubyOnRails
[00:09:26] roamingdog: has joined #RubyOnRails
[00:11:19] shilon: has joined #RubyOnRails
[00:12:37] mitt3ns: has joined #RubyOnRails
[00:14:56] havenwood: has joined #RubyOnRails
[00:33:29] Matrix9180: has joined #RubyOnRails
[00:35:47] cam27: has joined #RubyOnRails
[00:38:37] ascarter: has joined #RubyOnRails
[00:39:46] unreal: has joined #RubyOnRails
[00:41:06] Pumukel: has joined #RubyOnRails
[00:55:02] apparition: has joined #RubyOnRails
[00:57:44] mikecmpbll: has joined #RubyOnRails
[01:00:56] renegadeandy: has joined #RubyOnRails
[01:03:02] gusrub: has joined #RubyOnRails
[01:06:55] aperkins81: has joined #RubyOnRails
[01:09:33] duderonomy: has joined #RubyOnRails
[01:17:07] bpmedley: has joined #RubyOnRails
[01:27:59] sevenseacat: has joined #RubyOnRails
[01:41:51] Pumukel: has joined #RubyOnRails
[01:44:48] quazimodo: has joined #RubyOnRails
[01:47:02] brent__: has joined #RubyOnRails
[02:01:48] irishfromua: has joined #RubyOnRails
[02:02:59] Jameser: has joined #RubyOnRails
[02:08:24] Jameser: has joined #RubyOnRails
[02:15:25] xx00__: has joined #RubyOnRails
[02:39:34] xx00__: has joined #RubyOnRails
[02:43:08] Pumukel: has joined #RubyOnRails
[03:04:25] FCser: has joined #RubyOnRails
[03:04:44] quirkycoders: has joined #RubyOnRails
[03:11:20] Trynemjoel: has joined #RubyOnRails
[03:20:44] quirkycoders: has joined #RubyOnRails
[03:29:55] quirkycoders: has joined #RubyOnRails
[03:33:37] cjhowe: do i need to do anything to enable sourcemaps in the default rails asset pipeline?
[03:45:00] Pumukel: has joined #RubyOnRails
[03:45:19] gusrub: has joined #RubyOnRails
[03:48:58] Technodrome: has joined #RubyOnRails
[03:50:35] quirkycoders: has joined #RubyOnRails
[03:59:10] shotbug: has joined #RubyOnRails
[04:04:29] statikowsky: has joined #RubyOnRails
[04:09:36] patarr: has joined #RubyOnRails
[04:11:23] quirkycoders: has joined #RubyOnRails
[04:14:00] roamingdog: has joined #RubyOnRails
[04:14:50] irishfromua: has joined #RubyOnRails
[04:16:14] muhlisbc: has joined #RubyOnRails
[04:32:11] quirkycoders: has joined #RubyOnRails
[04:43:04] ascarter: has joined #RubyOnRails
[04:53:03] quirkycoders: has joined #RubyOnRails
[05:00:26] hndk: has joined #RubyOnRails
[05:03:54] armyriad: has joined #RubyOnRails
[05:14:01] quirkycoders: has joined #RubyOnRails
[05:25:12] sloggerkhan: has joined #RubyOnRails
[05:27:00] nahtnam: has joined #RubyOnRails
[05:32:39] watersoul: has joined #RubyOnRails
[05:34:46] quirkycoders: has joined #RubyOnRails
[05:37:34] watersoul: has joined #RubyOnRails
[05:37:39] mtkd: has joined #RubyOnRails
[05:46:44] Pumukel: has joined #RubyOnRails
[05:58:33] armyriad: has joined #RubyOnRails
[06:00:06] quirkycoders: has joined #RubyOnRails
[06:05:39] defsdoor: has joined #RubyOnRails
[06:10:35] patarr: has joined #RubyOnRails
[06:20:04] KeyJoo: has joined #RubyOnRails
[06:22:06] quirkycoders: has joined #RubyOnRails
[06:37:21] rfoust: has joined #RubyOnRails
[06:38:13] pLaTo0n: has joined #RubyOnRails
[06:42:59] quirkycoders: has joined #RubyOnRails
[06:46:00] cjhowe: has joined #RubyOnRails
[06:46:23] conta: has joined #RubyOnRails
[06:47:04] cjhowe: has joined #RubyOnRails
[06:47:35] Pumukel: has joined #RubyOnRails
[06:47:49] cjhowe: has joined #RubyOnRails
[07:02:21] Winter_Foxo: has joined #RubyOnRails
[07:03:49] quirkycoders: has joined #RubyOnRails
[07:09:38] mahloun: has joined #RubyOnRails
[07:11:10] Winter_Foxo: has joined #RubyOnRails
[07:12:25] srinidhi: has joined #RubyOnRails
[07:15:07] dionysus69: has joined #RubyOnRails
[07:16:19] Winter_Foxo: has joined #RubyOnRails
[07:21:02] Winter_Foxo: has joined #RubyOnRails
[07:23:45] statikowsky: has joined #RubyOnRails
[07:24:49] quirkycoders: has joined #RubyOnRails
[07:26:10] Winter_Foxo: has joined #RubyOnRails
[07:31:30] Winter_Foxo: has joined #RubyOnRails
[07:34:12] shotbug: has joined #RubyOnRails
[07:36:13] apparition: has joined #RubyOnRails
[07:36:34] Winter_Foxo: has joined #RubyOnRails
[07:38:29] mikecmpbll: has joined #RubyOnRails
[07:40:37] birdstheword: has joined #RubyOnRails
[07:41:05] DoubleMalt: has joined #RubyOnRails
[07:41:10] noob_on_rails: if i've made a small change on the master branch , and i want it in the branch im currently working on , what git command should i run ?
[07:41:19] Winter_Foxo: has joined #RubyOnRails
[07:41:41] tbuehlmann: noob_on_rails: you could rebase master, you could also just merge master
[07:41:59] sevenseacat: you can use cherry-pick for copying individual commits
[07:42:02] noob_on_rails: hmm merge master in the current branch ?
[07:42:05] noob_on_rails: that's a good idea
[07:42:31] birdstheword: yeah as long as it's a single commit git cherry-pick
[07:43:54] birdstheword: I posted a question here earlier but I don't think anyone was around, it's super puzzling..... I've tried a ton of stuff so I'll ask one more time
[07:44:14] birdstheword: I'm running ruby 2.4.0 and rails 5.0.3. I have a controller that is the root controller and it renders just fine and is shown in the web browser for the FIRST user to access the controller. Any subsequent user never gets and http response, however, puma and the console logs seems to believe it rendered a 200 OK. gist example here https://gist.github.com/anonymous/9e4fe86f8506d5bfc7fd53f779d99cfa
[07:44:17] noob_on_rails: tbuehlmann: thanks , i merged master , it was quite scary but it's done :D
[07:45:12] birdstheword: noob_on_rails: the best part about git is just about everything can be undone :D
[07:45:31] sevenseacat: birdstheword: I'd suspect turbolinks
[07:45:31] quirkycoders: has joined #RubyOnRails
[07:45:45] birdstheword: sevenseacat: can you elaborate?
[07:45:47] ur5us: has joined #RubyOnRails
[07:46:07] sevenseacat: turbolinks uses JS to make the page requests and replace the body of the page, for a 'smoother' appearance
[07:46:16] Winter_Foxo: has joined #RubyOnRails
[07:46:26] sevenseacat: if something is going wrong in that replacement process, the requests are still being made fine, but you'll never see a change in the client
[07:46:49] sevenseacat: wait, subsequent *users*?
[07:47:05] birdstheword: hmmm, interesting thought, let me just straight up telnet from a different machine and see if I can get an http response
[07:47:14] sevenseacat: what does the second user get in their browser when they hit the page?
[07:47:15] birdstheword: like another client, another ip, another session
[07:47:26] sevenseacat: a blank page?
[07:47:35] birdstheword: a spinning wheel of chrome death
[07:47:43] sevenseacat: ok thats not a blank page
[07:48:07] sevenseacat: what does the browser network inspector say when making that request
[07:48:13] birdstheword: it's a lack of complete response, which is why I am baffled, and as experience has taught me, it's almost *never* network
[07:48:31] birdstheword: I believe it just says stalled
[07:48:45] Pumukel: has joined #RubyOnRails
[07:48:58] sevenseacat: dont think thats a proper http response
[07:49:21] birdstheword: it's not. I don't think it ever gets one. that's the baffling part
[07:49:40] birdstheword: but the server side console says it rendered one
[07:49:53] sevenseacat: soooooo what does the browser network inspector say
[07:50:19] birdstheword: brb vpn to confirm, rejoin
[07:51:13] Winter_Foxo: has joined #RubyOnRails
[07:52:59] Winter_Foxo: has joined #RubyOnRails
[07:57:58] Winter_Foxo: has joined #RubyOnRails
[07:59:37] birdstheword: No response, it just hangs, get failed.
[08:00:47] birdstheword: but the server console said there was a 200 OK rendered in 332 ms
[08:02:50] statikowsky: has joined #RubyOnRails
[08:02:55] Winter_Foxo: has joined #RubyOnRails
[08:07:29] birdstheword: I've thought it could be caching, or sessions, or some permissions or something crazy on one of the gems... I even tried just serving up a static page with no controller action other than render. So either it's some config I have, something wrong with the machine, or something I don't know about rails
[08:08:14] Winter_Foxo: has joined #RubyOnRails
[08:08:16] birdstheword: sevenseacat: the part that really confuses me is I can open any browser on the first machine and it will return the page, just any second client (ip) is a no go.
[08:08:46] sevenseacat: no response? the network inspector is empty?
[08:08:56] sevenseacat: so no request is being made at all?
[08:09:01] birdstheword: the tcp connection eventually dies
[08:09:16] birdstheword: well it's one way, clearly it gets to the server, just not back to the client.
[08:09:36] sevenseacat: so the network inspector isnt empty? what does it say?
[08:10:01] dionysus69: has joined #RubyOnRails
[08:10:23] mikecmpbll: has joined #RubyOnRails
[08:11:21] patarr: has joined #RubyOnRails
[08:12:51] Winter_Foxo: has joined #RubyOnRails
[08:17:26] Winter_Foxo: has joined #RubyOnRails
[08:17:50] birdstheword: trying to find a concrete example. don't have a second machine in front of me
[08:21:23] birdstheword: don't know that I can at the moment, suppose I'll just have to try again tomorrow.
[08:21:33] birdstheword: thanks for the help sevenseacat :)
[08:22:26] Winter_Foxo: has joined #RubyOnRails
[08:23:17] User458764: has joined #RubyOnRails
[08:27:02] Winter_Foxo: has joined #RubyOnRails
[08:32:18] Winter_Foxo: has joined #RubyOnRails
[08:37:01] Winter_Foxo: has joined #RubyOnRails
[08:37:59] irishfromua: has left #RubyOnRails: ()
[08:41:29] workmad3: has joined #RubyOnRails
[08:42:17] Winter_Foxo: has joined #RubyOnRails
[08:43:22] ErhardtMundt: has joined #RubyOnRails
[08:47:25] Winter_Foxo: has joined #RubyOnRails
[08:47:49] arup_r: has joined #RubyOnRails
[08:49:55] Pumukel: has joined #RubyOnRails
[08:52:34] Winter_Foxo: has joined #RubyOnRails
[08:57:41] Winter_Foxo: has joined #RubyOnRails
[09:00:37] lxsameer: has joined #RubyOnRails
[09:02:36] konsolebox: has joined #RubyOnRails
[09:02:50] Winter_Foxo: has joined #RubyOnRails
[09:07:44] Winter_Foxo: has joined #RubyOnRails
[09:08:05] armando: has joined #RubyOnRails
[09:08:45] quirkycoders: has joined #RubyOnRails
[09:11:10] shotbug: has joined #RubyOnRails
[09:12:50] Winter_Foxo: has joined #RubyOnRails
[09:17:22] Winter_Foxo: has joined #RubyOnRails
[09:20:34] ur5us: has joined #RubyOnRails
[09:22:02] Winter_Foxo: has joined #RubyOnRails
[09:27:01] Winter_Foxo: has joined #RubyOnRails
[09:30:02] Winter_Foxo: has joined #RubyOnRails
[09:34:55] Winter_Foxo: has joined #RubyOnRails
[09:39:30] Winter_Foxo: has joined #RubyOnRails
[09:44:20] Winter_Foxo: has joined #RubyOnRails
[09:48:37] gusrub: has joined #RubyOnRails
[09:49:15] Winter_Foxo: has joined #RubyOnRails
[09:50:19] quirkycoders: has joined #RubyOnRails
[09:51:26] Pumukel: has joined #RubyOnRails
[09:54:04] Winter_Foxo: has joined #RubyOnRails
[09:54:10] shotbug: has joined #RubyOnRails
[09:58:08] dionysus69: has joined #RubyOnRails
[09:59:08] marr: has joined #RubyOnRails
[09:59:14] Winter_Foxo: has joined #RubyOnRails
[10:02:54] cek: has joined #RubyOnRails
[10:03:34] srinidhi: has joined #RubyOnRails
[10:04:25] Winter_Foxo: has joined #RubyOnRails
[10:07:33] Winter_Foxo: has joined #RubyOnRails
[10:12:21] patarr: has joined #RubyOnRails
[10:14:18] ur5us: has joined #RubyOnRails
[10:15:56] ferr: has joined #RubyOnRails
[10:19:34] xco: has joined #RubyOnRails
[10:21:54] glasz: has joined #RubyOnRails
[10:24:36] cek: how do I override activejob logging?
[10:25:07] cek: seems like it's doing ActiveJob::Logging::LogSubscriber.attach_to :active_job right after logsub definition, which give me less options to hack it
[10:26:45] bruce_lee: has joined #RubyOnRails
[10:32:30] patarr: has joined #RubyOnRails
[10:32:33] quirkycoders: has joined #RubyOnRails
[10:33:56] cjhowe: has joined #RubyOnRails
[10:45:31] roamingdog: has joined #RubyOnRails
[10:53:13] quirkycoders: has joined #RubyOnRails
[11:14:06] quirkycoders: has joined #RubyOnRails
[11:21:25] arBmind: has joined #RubyOnRails
[11:30:15] HoierM_: has joined #RubyOnRails
[11:31:28] Technodrome: has joined #RubyOnRails
[11:35:16] quirkycoders: has joined #RubyOnRails
[11:40:07] p8m: has joined #RubyOnRails
[11:41:06] Ergo: has joined #RubyOnRails
[11:42:08] xco: has joined #RubyOnRails
[11:44:12] gregf_: has joined #RubyOnRails
[11:49:37] romeoh: has joined #RubyOnRails
[11:53:17] Pumukel: has joined #RubyOnRails
[11:56:35] HoierM_: has joined #RubyOnRails
[11:57:29] renegadeandy: has joined #RubyOnRails
[11:57:36] brendan-: has joined #RubyOnRails
[12:10:40] soahccc: We made a somewhat bad decision back in rails 4 when we added a getter method price returning a object while having a DB column with the same name. In rails 4 it never was a problem but when we migrated to rails 5 we had to add a to_s method as the forms were screwed. Everything else seems to work.
[12:11:59] soahccc: Now the problem: We have a numericality (gt > 0) validator on the price and it works always, for everyone but THAT one guy raises exceptions of the following: "undefined method `>' for #<Product::Price:0x007f1088c128d0>"
[12:12:37] soahccc: I mean I could add that method to the object as well but how does he do that, I'm unable to reproduce it and there was nothing fishy about the price he submitted
[12:14:36] quirkycoders: has joined #RubyOnRails
[12:14:53] quirkycoders: has joined #RubyOnRails
[12:15:52] romeoh: has joined #RubyOnRails
[12:23:33] Pumukel: has joined #RubyOnRails
[12:28:00] pupsicle: has joined #RubyOnRails
[12:28:17] quazimodo: has joined #RubyOnRails
[12:30:34] arup_r: has joined #RubyOnRails
[12:33:00] soahccc: I digged a bit into the validator and I think the only way this happens is if attribute_changed_in_place? returns true but I can't really figure out what could possibly cause something like that. Any ideas?
[12:34:30] xco: has joined #RubyOnRails
[12:43:49] Technodrome: has joined #RubyOnRails
[12:47:14] rgr: has joined #RubyOnRails
[12:48:34] jtperreault: has joined #RubyOnRails
[12:49:22] Matrix9180: has joined #RubyOnRails
[13:06:23] Matrix9180: has joined #RubyOnRails
[13:09:36] xx00__: has joined #RubyOnRails
[13:10:04] roamingdog: has joined #RubyOnRails
[13:12:30] francuz: hello everyone, what do you guys use to backup databases?
[13:16:05] Technodrome: has joined #RubyOnRails
[13:21:01] uksio: has joined #RubyOnRails
[13:22:02] soahccc: francuz: what kind of backup are we talking about? Frequency, DB size.
[13:23:27] soahccc: I personally do dumps from a slave and compress&upload them to a server with more storage
[13:23:52] mordof: our stuff is all in amazon, so we just have regular snapshots of the disk the db is on
[13:24:04] mordof: ACTION chimes in just to show variety of ways to deal with it
[13:24:26] francuz: small DBs(would be just like 3-5 mb), every 2hours,
[13:24:50] mordof: in that case i'd probably just pgdump to a backup drive or something with a cron task
[13:24:55] soahccc: francuz: we do dumps every 15 minutes with 3-5 GB xD you should be fine
[13:25:08] mordof: no kidding, lol
[13:25:39] soahccc: 2017-05-24 130.8 GB younger than 7 days, keep all
[13:26:14] mordof: especially at 3-5mb a piece
[13:26:40] mordof: 420mb for 7 days worth of backups
[13:26:42] francuz: perfect, that's what i'm doing for now, but as i'm mostly self taught in web oriented programation i always like to check if i do it the right way,
[13:27:23] soahccc: francuz: well the best way are snapshots imho but the reason for this is speed/DB locktime
[13:29:24] francuz: for now i have only one vps and very low budget, but in the long term i plan of having a server for db, and do snapshots,
[13:31:52] DLSteve: has joined #RubyOnRails
[13:31:59] mordof: francuz: unless you're running something with crazy high load on the db, or really need some form of redundancy - the size of your database won't need it's own box for quite some time
[13:32:39] mordof: francuz: you can also just add a really small hard drive where the database stores the data, and do snapshots of that drive itself (connected to the same server)
[13:33:02] mordof: if the vps environment you're in allows you to add individual hard drives
[13:36:13] francuz: thanks for the info, i'll check all the option, not there yet,
[13:40:14] Jakaria: has joined #RubyOnRails
[13:40:21] Jakaria: need a help..... how can I use relationship of a model in a test class??? I am using factory-girl... when I write this in a test, it shows "null" in the terminal... >> puts user.role.to_json
[13:40:25] Jakaria: I am using Rails 5
[13:42:35] bobbobbins: has joined #RubyOnRails
[13:47:00] shilon: has joined #RubyOnRails
[13:48:02] gregf_: has joined #RubyOnRails
[13:48:15] ule: Do we have a kind of best practice saying to not create private method in models?
[13:48:33] ule: I feel like I'm working with same weird codes here
[13:48:45] apparition: has joined #RubyOnRails
[13:49:51] netzfisch: has joined #RubyOnRails
[13:50:17] quirkycoders: has joined #RubyOnRails
[13:52:48] francuz: i see a lot of reason to have private methods in models and no reason not to write them when they are needed
[13:55:29] quirkycoders: has joined #RubyOnRails
[13:56:06] ResidentBiscuit: has joined #RubyOnRails
[13:56:07] tbuehlmann: francuz: the other way around. just make methods public that needs to be public
[13:58:38] francuz: but as the question was about private functions
[13:59:42] tbuehlmann: I don't get it then
[14:01:12] bheesham: has joined #RubyOnRails
[14:01:29] francuz: Do we have a kind of best practice saying to not create private method in models? => No there is no best practice saying that, as private method are something usefull,
[14:01:39] mordof: the question, restated, was basically just "is it ok to make private methods in models?" the answer being, yes - whenever something isn't explicitly needed to be public, make it private
[14:01:57] francuz: ow, unless the question was rethoric,
[14:02:11] mordof: that's the way i understood it anyway *shrugs*
[14:02:13] dionysus70: has joined #RubyOnRails
[14:03:06] soahccc: Haha I figured out my validation error :D validation attempts to use raw_value (dirty attribute) and if the product get saved multiple times (e.g. updated_at changes through touching relations) the raw_value gets purged and only then it calls the accessor...
[14:04:49] quirkycoders: has joined #RubyOnRails
[14:05:06] quirkycoders: has joined #RubyOnRails
[14:05:48] centrx: has joined #RubyOnRails
[14:20:59] daveomcd: has joined #RubyOnRails
[14:23:42] patarr: has joined #RubyOnRails
[14:25:09] mrbubbles: has joined #RubyOnRails
[14:25:21] daveomcd: I'm running my website on an ubuntu server. I have to update the server, and while most questions for that I'll handle in #ubuntu, I didn't know if there were any helpful scripts - or things to take in to consideration when updating the server specific to one hosting a rails app?
[14:26:01] centrx: daveomcd: you probably want to update your gems too
[14:26:26] centrx: daveomcd: if you're talking about updating between releases of Ubuntu, your gems could depend on the older version
[14:26:46] centrx: daveomcd: if you just mean security updates, Ruby/Rails gems are probably fine as-is
[14:28:25] lupine: has joined #RubyOnRails
[14:29:12] daveomcd: centrx, I plan on installing security updates. Package updates I was going to try and do, after taking a snapshot of my server, and see if everything is OK afterwards. But I wasn't planning on updating Ubuntu versions such as 16.10 to 17.04
[14:29:24] centrx: daveomcd: it should be fine
[14:29:49] centrx: daveomcd: the main issue is gems that might depend on different versions of underlying software, or gems that were compiled with one version of the library, but now you have a different version
[14:30:44] Jakaria: has left #RubyOnRails: ("WeeChat 1.4")
[14:31:09] daveomcd: centrx, so let me ask you this pertaining to that issue. If I have the same gem versions on my development machine (which is completely up-to-date) but they are running fine is that a good indicator they should be fine?
[14:31:15] srinidhi: has joined #RubyOnRails
[14:31:27] centrx: daveomcd: yes, except for the compilation issue
[14:31:41] centrx: daveomcd: some gems have C code that are compiled on install
[14:32:08] centrx: daveomcd: but that would just require a recompile
[14:32:22] hipothera: has joined #RubyOnRails
[14:32:47] daveomcd: a recompile would be me uninstalling/reinstalling the specific gems?
[14:34:17] AzaToth: has joined #RubyOnRails
[14:34:34] mikecmpbll: has joined #RubyOnRails
[14:35:21] hipothera: Hello! I am failing at searching for a string inside an ActiveRecord string attribute. It has two more attributes, which are being filter beforehand. May you please help me? CODE, PARAMS and ERR: https://gist.github.com/anonymous/fc2b129c5bbc753278b430afa3b9f159 Thanks. PS: when no keyword is introduced, it returns zero results.
[14:36:28] hipothera: > I am using A with Sinatra btw. #Ruby sent me here.
[14:36:43] hipothera: #activerecord
[14:37:00] urkle: has joined #RubyOnRails
[14:40:01] arup_r: has joined #RubyOnRails
[14:44:59] shilon: has joined #RubyOnRails
[14:48:22] quazimodo: has joined #RubyOnRails
[14:48:24] centrx: hipothera: For some reason the % are being put outside the quotes
[14:49:30] GodFather: has joined #RubyOnRails
[14:49:30] centrx: hipothera: .where("description LIKE %?%",k) should probably have quotes around '%?%'
[14:49:50] tbuehlmann: try Youtuber.where('description LIKE ?', "%#{k}%")
[14:51:39] soahccc: daveomcd: I guess you bundle per app? I bundled manually with a different path and then replaced the directory with an app restart, I did that when I updated ruby
[14:51:58] hipothera: @tbuehlmann That worked earlier, but I couldn't find the way of integrating country and genre in the same query. May you help me with this?
[14:52:25] jphase: has joined #RubyOnRails
[14:52:30] tbuehlmann: what's the problem?
[14:52:40] workmad3_: has joined #RubyOnRails
[14:55:43] daveomcd: soahccc, yea I bundle per app I believe.
[14:56:04] centrx: #{k} SANITIZATION ALERT
[14:56:16] hipothera: @tbuehlmann Youtuber.where('description LIKE ?', "%#{k}%") finds by description, but ignores to filter and exclude only the results that match params[:country] and params[:genre].
[14:56:55] tbuehlmann: centrx: it's sanitized, just not LIKE-sanitized
[14:57:17] hipothera: ok ok my apologies, not a pro
[14:57:27] centrx: tbuehlmann: How is it sanitized? it's just dropping a variable in a string
[14:57:28] tbuehlmann: hipothera: if you know how to do it with one argument, what's the problem with two?
[14:57:43] tbuehlmann: centrx: using ? and a second argument sanitizes
[14:57:57] centrx: oh woops I misread
[14:58:09] centrx: didn't see it was still using the ?
[15:02:47] soahccc: Anyone using letsencrypt with a ruby client by chance? Apparently the client I use doesn't work with ubuntu's shipped openssl version :(
[15:06:25] xco: has joined #RubyOnRails
[15:06:46] shilon: hey everyone. I’m trying to seed some data, here is my code: https://gist.github.com/jamesalbuquerque/a1d6595dfbde74feda74f2f073038add When I try to update the Brands owner_id (last line) all my brands get the exact same id number… Anyone knows what I’m doing wrong?
[15:10:05] pwnd_nsfw: So, I've randomly been getting "This site can’t provide a secure connection" in chrome from my development server. https://gist.github.com/anonymous/a1012e5217bb7d9ee6951a54122f7462 Comes out of my console. Works correctly in IE, and did work in Chrome until recently. I've attempted deleting cookies, even resetting my Chrome's settings. This is broken on two different PCs. I use "rails s -b 0.0.0.0 -p 6969" to start th
[15:10:06] pwnd_nsfw: e server. (Another thing that randomly became an issue, I can't serve on port 3000 for whatever reason)
[15:11:27] centrx: Shilon: that's what that code is doing, update_all sets all the records to the same value
[15:11:46] shilon: so should I use update_attribute?
[15:11:57] shilon: or update_each?
[15:12:01] shilon: or it doesn’t exist?
[15:12:28] centrx: Shilon: You could either loop through all the records, right, or you could use some raw SQL to set the values, e.g. something with RAND()
[15:12:47] centrx: Shilon: easier to do it in Ruby, but faster execution to do it in SQL
[15:13:03] shilon: Brand.where( id: Brand.all.map(&:id) ).offset( owner_id: User.offset(rand(User.count)).first.id) ?
[15:13:19] mikecmpbll: has joined #RubyOnRails
[15:13:31] cam27: has joined #RubyOnRails
[15:16:44] pwnd_nsfw: May I ask why you're using offset?
[15:17:14] pwnd_nsfw: wouldn't just... find(rand(....)) produce similar results, but then you wouldn't have to "first" on it?
[15:17:50] pwnd_nsfw: And doesn't Brand.all.map(&:id) give you all of the ids? Where you could just do Brand.all?
[15:18:16] shilon: pwnd_nsfw: it gives me all the Ids, the problem is the second part
[15:18:29] pwnd_nsfw: update_all, right?
[15:18:35] shilon: adding a different owner_id to each brand
[15:18:50] shilon: and it should be unique
[15:19:00] shilon: I’ve tried first.id.unique but it doesn’t work
[15:19:31] pwnd_nsfw: Why not just create a new user each time you create a new brand
[15:19:34] pwnd_nsfw: that may be much easier
[15:19:42] pwnd_nsfw: Then you can just create a bunch more users on top of that
[15:19:48] pwnd_nsfw: after you've taken care of your brands
[15:20:16] shilon: with nested attributes?
[15:20:35] pwnd_nsfw: nah, one sec
[15:20:36] hipothera: @tbuehlmann All set with this line. Thanks! -> Youtuber.where("description LIKE ? AND country LIKE ? AND genre LIKE ?", "%#{k}%", params[:country], params[:genre])
[15:20:39] shilon: in the app I have it that way, but on the seeds I couldn’t manage to do it
[15:20:40] dblessing: has joined #RubyOnRails
[15:20:56] shilon: when you register a user it builds a brand
[15:21:59] pwnd_nsfw: Can you give me your brand.rb, user.rb and your schema
[15:22:01] xco: has joined #RubyOnRails
[15:22:10] shilon: yes, I’ll add it to the gist
[15:23:45] shilon: pwnd_nsfw: done :)
[15:23:49] shilon: need the link again?
[15:23:56] shilon: https://gist.github.com/jamesalbuquerque/a1d6595dfbde74feda74f2f073038add
[15:23:58] pwnd_nsfw: Also, you don't use an array as parameters, you just pass the hash as is. no brackets, etc. Butts.create(big: true, delicious: true)
[15:24:50] shilon: pwnd_nsfw: I should remove [] from each array?
[15:26:38] shilon: pwnd_nsfw: could I use the models to do this work of adding the owner_id?
[15:27:05] shilon: a method that adds the owner_id on create or something
[15:27:07] pwnd_nsfw: one sec, making an example for you
[15:27:25] shilon: thank you :)
[15:29:26] tristaan: has joined #RubyOnRails
[15:32:52] pwnd_nsfw: his code is pretty dirty, I'm assuming he doesn't understand some rails basics hmmmm
[15:34:09] centrx: yeah, using .offset to update the attribute...
[15:34:26] pwnd_nsfw: And the rest of the code is incredibly problematic lol
[15:34:40] pwnd_nsfw: I don't know what "owner" is on the user model
[15:34:54] pwnd_nsfw: But it is set to true or false
[15:34:56] pwnd_nsfw: ACTION shrugs
[15:35:07] pwnd_nsfw: He's gonna be back in 20 minutes he said.
[15:35:55] ghormoon: has joined #RubyOnRails
[15:41:05] pwnd_nsfw: I'm sure he's not testing any of his code either ;P
[15:41:08] centrx: ACTION can't wait
[15:41:39] ghormoon: has joined #RubyOnRails
[15:42:59] pwnd_nsfw: This ssl issue is really bothering me
[15:43:03] pwnd_nsfw: Appeared out of nowhere
[15:44:21] tristaan: where do you have this issue?
[15:44:56] pwnd_nsfw: Using rasp pi for dev box, running raspbian
[15:45:03] pwnd_nsfw: Without UI, just console
[15:45:22] pwnd_nsfw: Not being able to use port 3000 is also a random occurance
[15:45:31] pwnd_nsfw: I'll repaste from above, one moment
[15:45:48] pwnd_nsfw: So, I've randomly been getting "This site can’t provide a secure connection" in chrome from my development server. https://gist.github.com/anonymous/a1012e5217bb7d9ee6951a54122f7462 Comes out of my console. Works correctly in IE, and did work in Chrome until recently. I've attempted deleting cookies, even resetting my Chrome's settings. This is broken on two different PCs. I use "rails s -b 0.0.0.0 -p 6969" to start th
[15:45:54] pwnd_nsfw: e server. (Another thing that randomly became an issue, I can't serve on port 3000 for whatever reason)
[15:46:05] pwnd_nsfw: No longer works in IE now
[15:49:57] tristaan: Hmm.. I had the same problem, but it was because of apache and a configuration change. from v2.idk to v2.4
[15:50:21] patarr: Hi. I'm hosting static files in public/foo and foo/index.html uses relative links like "./home.css". If you access the index page by `/foo`, this breaks because the relative links are resolving to `/home.css'. But if you access the index page with `/foo/` then it will properly resolve to `/foo/home.css`. Is there any way to resolve this in Rails?
[15:51:06] tristaan: It was connected with the certificate bundle. I had my public part in an extra file and the change was that it needs to be appended to the bundle.
[15:51:09] gusrub: has joined #RubyOnRails
[15:51:22] pwnd_nsfw: I'm quite sure I'm not using apache at all
[15:51:46] tristaan: yes I understood. But maybe you have issues with your bundle
[15:54:12] tristaan: I have a question about minitest and the error I am getting: 'aggregated_results': wrong number of arguments (given 1, expected 0) (ArgumentError)
[15:54:48] tristaan: tests complete just fine. I also found an issue on github. But without comments.
[15:55:47] pwnd_nsfw: May I ask how the tests complete? XD
[15:56:03] tristaan: I found the answer just now: Minitest::Reporters.use! in test/test_helper.rb
[15:57:20] pwnd_nsfw: I did find another issue with comments
[15:57:20] pwnd_nsfw: https://github.com/seattlerb/minitest/issues/689
[15:59:33] tristaan: Ahh. It got fixed.
[16:01:55] Technodrome: has joined #RubyOnRails
[16:02:19] tristaan: Changed from the test_helper.rb fix to adding a line in my Gemfile as it seems cleaner.
[16:06:01] shilon: has joined #RubyOnRails
[16:06:08] tristaan: TDD is a thing that I should have known since I was 5.
[16:06:55] roshanavand: has joined #RubyOnRails
[16:07:00] pwnd_nsfw: RIGHT THOUGH?
[16:07:07] shilon: pwnd_nsfw: hey :)
[16:07:54] rakm: has joined #RubyOnRails
[16:11:09] hobodave: has joined #RubyOnRails
[16:18:12] arup_r: has joined #RubyOnRails
[16:18:40] arup_r: liquid-silence: You can check this video for the question u asked yesterday https://gorails.com/episodes/migrating-from-jquery-to-vanilla-javascript
[16:29:56] am55: arup_r, is it worth doing that?
[16:31:22] arup_r: what do you mean?
[16:32:05] am55: should I work on removing jquery from my app?
[16:32:52] arup_r: Are you in Rails 5.1?
[16:32:54] am55: I'm not using a js framework otherwise
[16:34:01] arup_r: ok then don't need to sweat 😅
[16:34:26] rgr_: has joined #RubyOnRails
[16:34:29] francuz: even if this is not a dependency anymore, what reason can make us "not use jquery" ? (new to web, and curious)
[16:34:52] arup_r: he had asked something related rails 5.1 removal of jQuery default support, so thought to give him a link if that helps,
[16:35:32] am55: I know that I use jquery methods not listed there
[16:36:06] arup_r: these days JS is more robust after ES2015 and Rails 5.1 has supprt for it.. so plain JS can do what jQuery do.. but it is upto developers choices :)
[16:36:36] francuz: yeah but if somebody is doing it, it means there is a reason to do it, i'm curious about what could be the reason/in what case it can be interesting to do it
[16:37:37] arup_r: I then need to go and get github PR to find out the reason of rewrite the of ujs lib :)
[16:37:49] arup_r: I think that PR will have all discussions back and forth
[16:38:01] gusrub: has joined #RubyOnRails
[16:38:10] robnester: has joined #RubyOnRails
[16:38:21] arup_r: francuz: ofcourse there is a reason, but dunno have any links right now with me :D
[16:38:37] arup_r: I need to search, I saw the discussions before in some PR
[16:40:25] robnester: has joined #RubyOnRails
[16:40:42] am55: i've caught bits and pieces of related discussion. http2 reduces incentive to bundle assets. if you use hosted jquery then users might have it cached already. if users are primary mobile then removing jquery could speed up first load? if users are primarily desktop, primarily internal, then maybe doesn't matter
[16:42:29] francuz: put it in my bookmarks to read next time i'm bored,
[16:44:11] noob_on_rails: i have this code where i choose if ill show a Select drop-menu item https://gist.github.com/frcake/0b19f20799ac18c9318971590a264e67
[16:44:34] noob_on_rails: but if the item is decided not to be shown i get a white line , is there a way to not show it completely ?
[16:46:10] rakm_: has joined #RubyOnRails
[16:48:07] pupsicle1: has joined #RubyOnRails
[16:48:54] rfoust: has joined #RubyOnRails
[16:49:06] cjhowe: has joined #RubyOnRails
[16:50:05] cjhowe: has joined #RubyOnRails
[16:50:41] cjhowe: has joined #RubyOnRails
[16:51:06] netzfisch: has joined #RubyOnRails
[16:53:22] armyriad: has joined #RubyOnRails
[16:57:42] roshanavand: has joined #RubyOnRails
[16:59:46] ascarter: has joined #RubyOnRails
[17:00:48] rakm: has joined #RubyOnRails
[17:02:37] duderonomy: has joined #RubyOnRails
[17:03:07] defsdoor: has joined #RubyOnRails
[17:04:16] hobodave: matthewd you around?
[17:08:13] irishfromua: has joined #RubyOnRails
[17:17:06] andywww: has joined #RubyOnRails
[17:19:05] andywww: if i had a Trip has_many Rides and wanted to write out a UL for the list using a decorator, would I typically have a list_rides in the Trip decorator, or use a Rides decorator and pass it the associated Trips?
[17:19:42] jgpawletko: has joined #RubyOnRails
[17:20:26] arup_r: has joined #RubyOnRails
[17:21:54] cek: has left #RubyOnRails: ()
[17:24:26] quirkycoders: has joined #RubyOnRails
[17:25:31] quirkycoders: I'm submitting the following form but in the controller I'm unable to process the params...I keep getting forbidden attributes but the correct attrributes are there and I'm excluded the others.
[17:25:33] quirkycoders: https://gist.github.com/jpstokes/a8d8cfa2345600d648df3ab4f068f1ef
[17:26:37] quirkycoders: The form is process by the #create_concierge action
[17:26:39] Technodrome: has joined #RubyOnRails
[17:37:26] chouhoulis: has joined #RubyOnRails
[17:39:46] urkle: has joined #RubyOnRails
[17:43:42] DoubleMalt: has joined #RubyOnRails
[17:45:58] tbuehlmann: quirkycoders: you still have to permit the attribute you want to allow, right?
[17:51:03] Technodrome: has joined #RubyOnRails
[17:58:41] hive-mind: has joined #RubyOnRails
[18:01:53] ascarter: has joined #RubyOnRails
[18:02:56] irishfromua: has joined #RubyOnRails
[18:04:01] quirkycoders: has joined #RubyOnRails
[18:18:19] workmad3: has joined #RubyOnRails
[18:24:51] ascarter: has joined #RubyOnRails
[18:29:06] Synthead: has joined #RubyOnRails
[18:36:45] centrx: has joined #RubyOnRails
[18:39:49] Technodrome: has joined #RubyOnRails
[18:48:55] quirkycoders: has joined #RubyOnRails
[18:53:26] ule: How would you escape this inside a hash? "---\n:phone_type: OS 7 device\n"
[18:53:41] quirkycoders: has joined #RubyOnRails
[18:53:47] ule: From that data, I'm getting this:
[18:53:50] ule: *** ActiveRecord::SerializationTypeMismatch Exception: Attribute was supposed to be a Hash, but was a String. --
[18:53:58] ule: Anyone can pls help?
[18:54:40] ule: Object.create({:foo => "---\n:phone_type: OS 7 device\n"})
[18:55:03] ule: The hash is way bigger, but the only issue is this data
[18:55:51] ule: quirkycoders: let me confirm if the error is being generated because of the "---" or ":"
[18:57:20] jobewan: has joined #RubyOnRails
[18:57:44] quirkycoders: Object.create({:foo => { phone_type: 'OS 7 device'}})
[18:58:14] watersoul: has joined #RubyOnRails
[18:58:22] quirkycoders: I think your function is looking for a hash instead of a string as the error states
[18:58:52] loechel: has joined #RubyOnRails
[18:59:30] ule: the problem is that "phone_type" is not a hash key.. it's inside my hash data
[19:00:04] ule: {:foo => "---\n:phone_type: OS 7 device\n"}
[19:00:19] ule: I want to insert exactly that data inside my "foo" field
[19:01:39] apeiros: ule: that string is yaml. and your serializer will convert your hash to that yaml.
[19:02:05] apeiros: but your serializer expects *unserialized* data. yet you give it *already serialized* data. hence quirkycoders's suggestion
[19:03:03] TinkerTyper: has joined #RubyOnRails
[19:05:13] bodie_: has joined #RubyOnRails
[19:05:17] gambl0re: has joined #RubyOnRails
[19:05:32] brent__: has joined #RubyOnRails
[19:06:17] weaksauce: has joined #RubyOnRails
[19:06:24] clamstar: has joined #RubyOnRails
[19:07:28] ule: apeiros: no the field has a text data with that exactly information inside that
[19:07:48] ule: I just need to escape that thing
[19:09:00] apeiros: read up on what serialization is, and what yaml is.
[19:10:12] cjhowe: has joined #RubyOnRails
[19:10:25] ule: If I tell you that I want to insert bar = "---\n:phone_type: OS 7 device\n" using Object.create({:foo => bar})
[19:11:38] apeiros: yes, and you refuse to learn the relevant information.
[19:14:07] mikecmpbll: has joined #RubyOnRails
[19:14:46] mahloun: has joined #RubyOnRails
[19:15:30] srinidhi: has joined #RubyOnRails
[19:19:45] xx00__: has joined #RubyOnRails
[19:26:25] mtkd: has joined #RubyOnRails
[19:29:15] ule: apeiros: you always giving me lessons
[19:29:28] ule: thanks my friend.. I'm gonna do some research about what you guys suggested
[19:29:35] ule: quirkycoders: thanks!
[19:29:46] ule: so.. another question
[19:29:52] apeiros: try `{ phone_type: 'OS 7 device'}.to_yaml` in pry/irb
[19:30:23] ule: foo.bar.pub123 how would you remove .pub123?
[19:31:11] ule: no, lets say it could be foobar.pub.pub123
[19:31:22] epochwolf: Or str.gsub(/\.pub123$/, "")
[19:31:23] apeiros: any other rules you omitted? :-p
[19:31:42] dionysus69: has joined #RubyOnRails
[19:31:46] apeiros: (I intentionally said str[0,7], since I was pretty sure you omitted a couple of rules)
[19:32:02] apeiros: which parts are dynamic? which parts are fixed?
[19:32:06] apeiros: will it always be two dots?
[19:32:27] apeiros: will the last section always be separated by the last dot?
[19:32:42] apeiros: will the last section always be .pub123? (fixed value? fixed length?)
[19:32:58] epochwolf: apeiros: regex solves all
[19:33:07] apeiros: epochwolf: only if you know the rules
[19:33:12] apeiros: otherwise, regex fucks up all :)
[19:33:19] apeiros: famous "now you've got two problems"
[19:33:30] epochwolf: apeiros: Yeah, but then it's not MY problem.
[19:33:46] apeiros: I want to be part of your world. how can I join?
[19:33:51] ule: they say thata regex is slow but that works
[19:36:51] quirkycoders: has joined #RubyOnRails
[19:39:45] epochwolf: ule: how is the regex slow? Is this code in a critical path?
[19:39:48] spheric: has joined #RubyOnRails
[19:40:41] Ferdroid: has joined #RubyOnRails
[19:41:48] ule: not necessary.
[19:41:53] ule: epochwolf: that helped a lot thanks!
[19:44:51] Ferdroid: has joined #RubyOnRails
[19:45:33] Ferdroid: has left #RubyOnRails: ()
[19:47:55] Ferdroid: has joined #RubyOnRails
[19:54:00] Coldblackice_: has joined #RubyOnRails
[20:04:15] shilon: has joined #RubyOnRails
[20:08:08] ule: epochwolf: I said that because I did a benchmark in the past and regex was way slower
[20:08:30] ule: but some milimicroseconds won't make the difference for what I'm doing here :)
[20:14:17] rfoust: has joined #RubyOnRails
[20:17:12] shilon: has joined #RubyOnRails
[20:22:23] rfoust: has joined #RubyOnRails
[20:22:25] mahloun: has joined #RubyOnRails
[20:25:33] patarr1: has joined #RubyOnRails
[20:29:50] Ashkin: has joined #RubyOnRails
[20:31:02] rfoust: has joined #RubyOnRails
[20:34:10] Ashkin: Anyone here have experience with Heroku? I'm having difficulty setting up bundler gem credentials using env vars. I've followed Heroku's guide, and verified the vars' names and values with `heroku status`, yet each push results in the remote `bundle install` failing due to missing credentials. i'm rather lost.
[20:43:07] Synthead: has joined #RubyOnRails
[20:43:56] quirkycoders: has joined #RubyOnRails
[20:44:23] rfoust: has joined #RubyOnRails
[20:49:41] hndk: has joined #RubyOnRails
[20:50:32] rfoust: has joined #RubyOnRails
[20:51:42] desnudopenguino: has joined #RubyOnRails
[20:51:58] agent_white: has joined #RubyOnRails
[21:01:34] urkle: has joined #RubyOnRails
[21:19:24] havenwood: Ashkin: What environment variable is expected? Show the code that uses that env var?
[21:20:44] Ashkin: it's an env var storing the username:password credentials for a gem (actually domain), used by bundler.
[21:21:57] Ashkin: i suppose i could dig through bundler's source and see exactly what it's expecting. (however, the guide on Heroku lists it explicitly for the very domain i'm using, so i feel i'm safe in assuming it's correct)
[21:22:23] ur5us: has joined #RubyOnRails
[21:23:04] Ashkin: Specifically, it's set in this way: `heroku config:set BUNDLE_GEMS__CONTRIBSYS__COM=username:password` (for gems.contribsys.com, which is hosting the gem in question)
[21:26:17] Ashkin: `heroku config | grep BUNDLE` returns `BUNDLE_GEMS__CONTRIBSYS__COM: [redacted]:[redacted]` as expected, which means there must be something else i'm missing.
[21:27:48] Ashkin: the Heroku guide i'm following is here: https://devcenter.heroku.com/articles/bundler-configuration, and i've looked at several other guides as well. they all list the same / very similar steps
[21:28:18] roamingdog: has joined #RubyOnRails
[21:38:42] quazimodo: has joined #RubyOnRails
[21:38:48] roshanavand: has joined #RubyOnRails
[21:44:11] xx00__: has joined #RubyOnRails
[21:44:36] HoierM_: has joined #RubyOnRails
[22:03:21] Ashkin: is this channel always this dead?
[22:03:54] Ashkin: and where else could i ask for help?
[22:15:12] rfoust: has joined #RubyOnRails
[22:17:53] patarr: has joined #RubyOnRails
[22:18:16] Pumukel: has joined #RubyOnRails
[22:28:34] xx00__: has joined #RubyOnRails
[22:29:20] roamingdog: has joined #RubyOnRails
[22:48:59] Kestrel-029: has joined #RubyOnRails
[22:54:06] quirkycoders: has joined #RubyOnRails
[22:55:12] quirkycoders: has joined #RubyOnRails
[23:02:10] quirkycoders: has joined #RubyOnRails
[23:12:34] Ashkin: well this is pointless.
[23:12:48] quirkycoders: has joined #RubyOnRails
[23:18:37] havenwood: A lot of folk are probably getting off work right now or just got off and the aussies may not be awake yet.
[23:19:12] havenwood: Ashkin: Are there supposed to be double underscore? It appears there are: BUNDLE_GEMS__CONTRIBSYS__COM
[23:20:00] havenwood: >> 'BUNDLE_GEMS__CONTRIBSYS__COM'.match? /_{2}/
[23:21:48] Radar: [08:03:20] <Ashkin> is this channel always this dead?
[23:22:03] Radar: If you ask that after 5pm eastern and before 9am australian eastern you're gonna have a bad time
[23:25:34] Radar: Also: Heroku Support is pretty responsive to this sort of thing.
[23:29:15] hndk: has joined #RubyOnRails
[23:30:45] Papierkorb: has joined #RubyOnRails
[23:31:24] Synthead: has joined #RubyOnRails
[23:34:44] GodFather: has joined #RubyOnRails
[23:40:10] roshanavand: has joined #RubyOnRails
[23:43:50] Ashkin: havenwood: yes. dots are invalid in env var names, so they're replaced with double _'s
[23:44:29] Ashkin: Radar: the curse of being a nightowl in PST: nobody is ever around when i'm working. :<
[23:45:01] havenwood: Ashkin: Ah, yeah I see in their docs that's really the env, dunders and all.
[23:45:11] Ashkin: Anyway, I finally gave up and opened a support ticket with Heroku to try and resolve my aforementioned bundler credential issue.
[23:45:15] ahrs: has joined #RubyOnRails
[23:46:19] Ashkin: apologies for my impatience; i've been fighting with this issue for two days, and haven't been able to find help bloody anywhere.