« Back to channel list

#RubyOnRails - 22 July 2016

« Back 1 day Forward 1 day »
[00:05:28] yfeldblum: has joined #RubyOnRails
[00:06:59] pur3eval: has joined #RubyOnRails
[00:07:36] djbkd: has joined #RubyOnRails
[00:12:36] chipotle_: has joined #RubyOnRails
[00:13:50] chipotle_: has joined #RubyOnRails
[00:15:10] baash05: has joined #RubyOnRails
[00:16:09] jstransky: has joined #RubyOnRails
[00:16:38] l4v2: has joined #RubyOnRails
[00:18:01] zacts: has joined #RubyOnRails
[00:18:46] lechiffre10: does anyone here have experience setting up Mandrill on rails?
[00:19:03] lechiffre10: im trying to get mandrill to send an email everytime a new user signs up but it won't work
[00:21:11] AzaToth: has joined #RubyOnRails
[00:21:51] dragon9783: has joined #RubyOnRails
[00:22:42] SteenJobs: has joined #RubyOnRails
[00:23:52] SteenJobs: ohhh so apparently cap can’t take execute arguments with whitespace
[00:24:17] greghoggard: has joined #RubyOnRails
[00:25:47] Radar: it can't?
[00:26:35] Dimik--: has joined #RubyOnRails
[00:26:45] pawnbox: has joined #RubyOnRails
[00:27:37] SteenJobs: Radar: it seems like ambiguities with string arguments can cause issues with SSHKit, so instead of execute “bundle exec rake db:migrate” in a custom task, it would have to be execute :bundle, :exec, :rake, “db:migrate”
[00:28:06] SteenJobs: Radar: i couldn’t figure out why cap/rvm wasn’t appending to bundle exec, causing a bundle: command not found error
[00:29:21] greghoggard: Hi #rubyonrails! I am having a slight problem implementing a part of my shopping cart on my app. It seems that whenever I add a duplicate item to the cart, instead of it updating the current item it creates an entirely new one. I know that I need to add some kind of validation to check if the OrderItem already exists and if it does to increment it but I'm not exactly sure the right way to do that or where it sh
[00:29:21] greghoggard: ould go. Here is my code: https://gist.github.com/greghoggard/31b6ef4d05451ef78f3cf3070b32a1ae
[00:29:28] jstransky: has joined #RubyOnRails
[00:29:41] blackmesa: has joined #RubyOnRails
[00:30:59] kriptonium: has joined #RubyOnRails
[00:31:03] SteenJobs: Radar: but now i’m a bit stuck - i want to run my custom task as “first_command && second_command && third_command”, but if i do them on three separate execute lines, it runs as three different lines
[00:31:36] SteenJobs: doesn’t appear to be great documentation for proper syntax
[00:31:42] SteenJobs: here’s what i have so far:
[00:31:56] srinidhi: has joined #RubyOnRails
[00:32:42] SteenJobs: https://gist.github.com/jesiegel1/198a58e4ffe21643e8d70e91096d84a8
[00:33:21] beilabs: has joined #RubyOnRails
[00:34:29] Oliphaunte: has joined #RubyOnRails
[00:35:15] SteenJobs: seems like really only the bundle and exec need the non string syntax
[00:35:35] SteenJobs: but still don’t know how to get cap-rvm to append the rvm path to each bundle exec in the three command string
[00:35:45] SteenJobs: well “string"
[00:36:20] greghoggard: has joined #RubyOnRails
[00:37:02] greghoggard: Hi #rubyonrails! I am having a slight problem implementing a part of my shopping cart on my app. It seems that whenever I add a duplicate item to the cart, instead of it updating the current item it creates an entirely new one. I know that I need to add some kind of validation to check if the OrderItem already exists and if it does to increment it but I'm not exactly sure the right way to do that or where it sh
[00:37:02] greghoggard: ould go. Here is my code: https://gist.github.com/greghoggard/31b6ef4d05451ef78f3cf3070b32a1ae
[00:38:19] FCser: has joined #RubyOnRails
[00:40:27] AzaToth: has joined #RubyOnRails
[00:40:52] leeky: has joined #RubyOnRails
[00:43:12] abhinavmehta: has joined #RubyOnRails
[00:43:40] SteenJobs: Radar: seems from the docs that it’s specifically the first argument
[00:43:53] Radar: SteenJobs: I don't know, sorry.
[00:44:17] SteenJobs: yea yea no worries - just correcting what i said before
[00:44:20] SteenJobs: irrespective of my issue
[00:44:51] superlou: has joined #RubyOnRails
[00:51:54] adavia: I am a little confused. How can i subscribe to a channel using actioncable after an ajax request
[00:59:42] jstransky: has joined #RubyOnRails
[01:02:06] hd1: has joined #RubyOnRails
[01:02:35] dessm: has joined #RubyOnRails
[01:02:40] AzaToth: has joined #RubyOnRails
[01:02:43] pawnbox: has joined #RubyOnRails
[01:05:32] dessm: Hi, I am not sure if it's okay to ask questions here (I apologize if it isn't), but I have what I suspect is a ridiculously easy question that I can't find the answer to despite extensive googling. I am trying to access an epub file from within a script tag in a view. Where do I need to save the file and how do I specify the path? I tried assets and indicating the full path without any...
[01:05:34] dessm: ...success. Any pointers of what might be going on or where I can find further information would be greatly appreciated. Thanks.
[01:06:03] petor: has joined #RubyOnRails
[01:08:20] dmz: has joined #RubyOnRails
[01:08:38] pickandmix: has joined #RubyOnRails
[01:08:39] lechiffre10: sorry my terminal is acting up
[01:08:44] lechiffre10: not sure if anyone answered my question
[01:08:47] lechiffre10: does anyone here have experience setting up Mandrill on rails?
[01:08:50] lechiffre10: im trying to get mandrill to send an email everytime a new user signs up but it won't work
[01:08:55] lechiffre10: sorry for repeating it
[01:11:50] boomer: has joined #RubyOnRails
[01:19:59] macsteps: has joined #RubyOnRails
[01:20:36] hd1: has joined #RubyOnRails
[01:29:03] Oliphaunte: has joined #RubyOnRails
[01:32:42] blackmesa: has joined #RubyOnRails
[01:37:03] eljimbo: has joined #RubyOnRails
[01:37:52] sevenseacat: has joined #RubyOnRails
[01:38:10] baash05: has joined #RubyOnRails
[01:38:41] beilabs: has joined #RubyOnRails
[01:38:44] pawnbox: has joined #RubyOnRails
[01:41:58] abhinavmehta: has joined #RubyOnRails
[01:43:58] weaksauce: has joined #RubyOnRails
[01:46:22] l4v2: has joined #RubyOnRails
[01:47:53] chipotle: has joined #RubyOnRails
[01:49:22] AzaToth: has joined #RubyOnRails
[01:53:16] petor: has joined #RubyOnRails
[01:57:10] zacts: has joined #RubyOnRails
[01:57:42] AzaToth: has joined #RubyOnRails
[01:58:23] maxdoubt: has joined #RubyOnRails
[01:58:36] harfangk: has joined #RubyOnRails
[02:01:16] adre: has joined #RubyOnRails
[02:02:07] beilabs: has joined #RubyOnRails
[02:04:49] _Tariq: has joined #RubyOnRails
[02:06:07] Axsuul: has joined #RubyOnRails
[02:06:46] zacts: has joined #RubyOnRails
[02:07:53] hd1: has left #RubyOnRails: ()
[02:08:01] donkeys_are_cool: has joined #RubyOnRails
[02:08:22] Ropeney: has joined #RubyOnRails
[02:09:51] AzaToth: has joined #RubyOnRails
[02:10:07] donkeys_are_cool: if you call the 'where' method inside an activerecord::base does rails just automatically do self.where?
[02:19:12] meinside: has joined #RubyOnRails
[02:22:23] AmiMoench: has joined #RubyOnRails
[02:23:13] Oliphaunte: has joined #RubyOnRails
[02:24:02] harfangk: has joined #RubyOnRails
[02:24:14] r3vDev: has joined #RubyOnRails
[02:25:32] Ropeney: donkeys_are_cool, yes
[02:25:58] petor: has joined #RubyOnRails
[02:26:01] sevenseacat: the implied target is always `self` if not specified.
[02:26:17] Ropeney: donkeys_are_cool, but you should test instead of ask :)
[02:27:21] wethu: has joined #RubyOnRails
[02:28:09] deprecated: has joined #RubyOnRails
[02:28:59] machinewar: has joined #RubyOnRails
[02:29:24] machinewar: I built a custom Rack Middleware that I mounted via mount: in routes.rb. Any idea why it would display the Rack::Builder object when I run rake routes
[02:30:30] machinewar: its not breaking anything, just strange
[02:32:40] beilabs: has joined #RubyOnRails
[02:35:45] blackmesa: has joined #RubyOnRails
[02:37:20] Axsuul: has joined #RubyOnRails
[02:38:30] macsteps: has joined #RubyOnRails
[02:39:55] andrecastelo: has joined #RubyOnRails
[02:41:09] abhinavmehta: has joined #RubyOnRails
[02:46:01] JesseH: has joined #RubyOnRails
[02:52:17] AzaToth: has joined #RubyOnRails
[02:53:40] Leepoff: has joined #RubyOnRails
[02:55:03] padi: has joined #RubyOnRails
[02:58:56] jfelchner: has joined #RubyOnRails
[02:59:37] Rodya_: has joined #RubyOnRails
[03:02:32] macsteps: has joined #RubyOnRails
[03:02:44] Coldblackice: has joined #RubyOnRails
[03:03:03] dblessing: has joined #RubyOnRails
[03:03:20] pawnbox: has joined #RubyOnRails
[03:03:25] beilabs: has joined #RubyOnRails
[03:04:41] djbkd: has joined #RubyOnRails
[03:06:14] _Tariq: has joined #RubyOnRails
[03:06:19] mostlybadfly: has joined #RubyOnRails
[03:09:00] Axsuul: has joined #RubyOnRails
[03:11:33] machinewar: how can I view documentation or source for rails rake commands?
[03:14:26] djbkd: has joined #RubyOnRails
[03:20:56] k3rn31: has joined #RubyOnRails
[03:23:09] harfangk: has joined #RubyOnRails
[03:23:29] yoongkang: has joined #RubyOnRails
[03:27:41] zacts: has joined #RubyOnRails
[03:29:27] Axsuul: has joined #RubyOnRails
[03:30:16] jenrzzz: has joined #RubyOnRails
[03:30:16] jenrzzz: has joined #RubyOnRails
[03:36:47] jenrzzz: has joined #RubyOnRails
[03:38:51] blackmesa: has joined #RubyOnRails
[03:39:48] padi: has joined #RubyOnRails
[03:40:03] AzaToth: has joined #RubyOnRails
[03:40:03] GnuYawk: has joined #RubyOnRails
[03:42:57] pawnbox: has joined #RubyOnRails
[03:43:01] xibalba: has joined #RubyOnRails
[03:44:42] nertzy: has joined #RubyOnRails
[03:49:31] dvinciguerra_: has joined #RubyOnRails
[03:57:10] baash05: has joined #RubyOnRails
[04:01:54] AzaToth: has joined #RubyOnRails
[04:04:59] k3rn31: has joined #RubyOnRails
[04:07:58] rickmasta: has joined #RubyOnRails
[04:11:14] Oliphaunte: has joined #RubyOnRails
[04:16:02] Leepoff: has joined #RubyOnRails
[04:17:15] petor: has joined #RubyOnRails
[04:18:30] danman: has joined #RubyOnRails
[04:23:41] kriptonium: has joined #RubyOnRails
[04:24:09] rickmasta: has joined #RubyOnRails
[04:27:05] Rodya_: has joined #RubyOnRails
[04:30:32] Coldblackice: has joined #RubyOnRails
[04:34:24] ProofTechnique: has joined #RubyOnRails
[04:41:47] blackmesa: has joined #RubyOnRails
[04:43:24] Coldblackice: has joined #RubyOnRails
[04:48:22] Oliphaunte: has joined #RubyOnRails
[04:49:09] alfiemax: has joined #RubyOnRails
[04:57:05] rvanlieshout: has joined #RubyOnRails
[05:01:14] yardenbar: has joined #RubyOnRails
[05:01:49] AzaToth: has joined #RubyOnRails
[05:07:08] danman: has joined #RubyOnRails
[05:08:26] Axsuul: has joined #RubyOnRails
[05:09:30] moeabdol: has joined #RubyOnRails
[05:13:03] xall_: has joined #RubyOnRails
[05:17:00] AzaToth: has joined #RubyOnRails
[05:17:53] wd40s: has joined #RubyOnRails
[05:19:14] zacts: has joined #RubyOnRails
[05:20:42] beilabs: has joined #RubyOnRails
[05:26:05] yoongkang: has joined #RubyOnRails
[05:32:35] jheathco: has joined #RubyOnRails
[05:36:00] wd40s: has joined #RubyOnRails
[05:38:47] sypheren: has joined #RubyOnRails
[05:44:49] blackmesa: has joined #RubyOnRails
[05:47:08] asianMike: has joined #RubyOnRails
[05:47:20] ProofTechnique: has joined #RubyOnRails
[05:50:11] daffy_duck: has joined #RubyOnRails
[05:51:13] dminuoso: has joined #RubyOnRails
[05:52:44] AzaToth: has joined #RubyOnRails
[05:53:15] daveomcd: has joined #RubyOnRails
[05:57:15] desmondhume: has joined #RubyOnRails
[06:02:41] adre: has joined #RubyOnRails
[06:05:49] jpterry: has joined #RubyOnRails
[06:07:18] Contigi777: has joined #RubyOnRails
[06:07:23] AzaToth: has joined #RubyOnRails
[06:10:51] Dimik--: has joined #RubyOnRails
[06:11:16] pydave6367: has joined #RubyOnRails
[06:11:23] Devalo: has joined #RubyOnRails
[06:11:59] Cohedrin: has joined #RubyOnRails
[06:12:29] AzaToth: has joined #RubyOnRails
[06:15:19] yfeldblum: has joined #RubyOnRails
[06:15:55] yfeldblum: has joined #RubyOnRails
[06:16:46] petor: has joined #RubyOnRails
[06:20:10] abhinavmehta: has joined #RubyOnRails
[06:22:05] wd40s: has joined #RubyOnRails
[06:22:12] Josh_: has joined #RubyOnRails
[06:23:35] agit0: has joined #RubyOnRails
[06:27:01] yoongkang: has joined #RubyOnRails
[06:27:31] dminuoso: has joined #RubyOnRails
[06:27:35] conta: has joined #RubyOnRails
[06:32:17] Devalo: has joined #RubyOnRails
[06:33:51] xall_: has joined #RubyOnRails
[06:34:18] Dbugger: has joined #RubyOnRails
[06:34:29] Dbugger: Good morning, ladies and gentlemen
[06:36:29] tildes: has joined #RubyOnRails
[06:36:58] sevenseacat: good afternoon dbugger. thank you for being more inclusive.
[06:37:01] Devalo: has joined #RubyOnRails
[06:37:25] Dbugger: sevenseacat, well, after being told about 100 times, it was about time I learn :D
[06:38:21] pickandmix: has joined #RubyOnRails
[06:38:51] jenrzzz: has joined #RubyOnRails
[06:38:54] jenrzzz: has joined #RubyOnRails
[06:41:04] dminuoso: has joined #RubyOnRails
[06:42:15] finnnnnnnnnnn: has joined #RubyOnRails
[06:44:57] padi: has joined #RubyOnRails
[06:45:05] abhinav: has joined #RubyOnRails
[06:47:53] blackmesa: has joined #RubyOnRails
[06:49:22] jstransky: has joined #RubyOnRails
[06:52:56] dkam: has joined #RubyOnRails
[06:55:02] r3vDev: has joined #RubyOnRails
[06:56:17] dminuoso: has joined #RubyOnRails
[06:57:23] umdstu: has joined #RubyOnRails
[06:57:30] apotry: has joined #RubyOnRails
[06:59:06] kriptonium: has joined #RubyOnRails
[07:02:02] arBmind: has joined #RubyOnRails
[07:12:54] TomyWork: has joined #RubyOnRails
[07:13:13] xall_: has joined #RubyOnRails
[07:13:25] S1kx: has joined #RubyOnRails
[07:14:27] jenrzzz: has joined #RubyOnRails
[07:14:38] darutoko: has joined #RubyOnRails
[07:14:55] jstransky: has joined #RubyOnRails
[07:15:27] Macaveli: has joined #RubyOnRails
[07:17:20] AimlessRAven: has joined #RubyOnRails
[07:17:30] AimlessRAven: someone have an idea how to optimize that
[07:17:30] AimlessRAven: https://gist.github.com/anonymous/fc618ffe5c92f1f0056ea043da88ef60
[07:17:32] AimlessRAven: to use less code
[07:18:26] dminuoso: AimlessRaven: Go read a basic Ruby book, look for ternary operator.
[07:18:45] dminuoso: Also read a basic Rails book, look for patterns such as decorators and presenters.
[07:19:30] AimlessRAven: dminuoso: i know this operator but i think i cant use it on list item
[07:19:54] blackmesa: has joined #RubyOnRails
[07:20:01] dminuoso: AimlessRaven: This is proof that you need to read a basic Ruby book.
[07:20:01] rvanlieshout: but you're not willing to invest time to find it out
[07:20:19] zacts: has joined #RubyOnRails
[07:20:26] dminuoso: AimlessRaven: You need to stop doing this non-sense and start learning the actual language.
[07:20:32] beilabs: has joined #RubyOnRails
[07:20:41] dminuoso: You should not even think about topics such as "authorization" if you can't figure out the basic language concepts.
[07:21:05] elomatreb: maybe watch the tone?
[07:21:21] dminuoso: elomatreb: With anyone else, I would.
[07:21:58] rvanlieshout: there indeed is a history to this
[07:22:41] Scient: decorators.... ew
[07:22:56] harfangk: has joined #RubyOnRails
[07:23:28] Scient: AimlessRaven: move your link to a helper, do the logic in the helper and keep your view clean as an example
[07:23:43] sevenseacat: I have no problem with people using somewhat harsher tones with people who refuse to learn.
[07:23:46] Scient: idk what a ternary operator has to do with anything, would not use it there... esp. in the view
[07:24:39] Scient: using a harsher tone is fine, doing it while giving bad advice or not with a good reason is a little meh?
[07:25:15] dminuoso: Scient: If you can't see how a ternary operator would reduce the line count by half in that code snippet, please don't give recommendations.
[07:25:33] dminuoso: Less even. Reduce by 60%
[07:25:33] sevenseacat: it would do that, at the creation of some butt-ugly code
[07:25:34] Scient: dminuoso: please stop pushing your shitty advice atm
[07:25:36] ur5us: has joined #RubyOnRails
[07:25:45] elomatreb: Scient: I disagree (on the tone part), unless you want the Ruby community to feel like the linux kernel mailing lists
[07:25:49] tercenya: has joined #RubyOnRails
[07:26:10] rvanlieshout: elomatreb: AimlessRaven has been here for a long time, but still refuses to follow any tutorial or read documentation
[07:26:26] Scient: like most people that ask help here :P
[07:26:47] rvanlieshout: and i agree with both Scient and dminuoso. A ternary operator would reduce half of that code, as AimlessRaven requested. Moving it to a helper or a decorator are also possibilities. Feel free to have opinions on if they are the right one
[07:26:54] Scient: anyways, point being that he hardly asked a question requiring a ton of ruby knowledge, or even consiting of a ton of ruby code
[07:27:17] Scient: so blowing him off by sending him to a rails tutorial seems to make absolutely no sense to me for this specific case
[07:27:20] Scient: but thats just me :)
[07:27:41] dionysus69: has joined #RubyOnRails
[07:27:45] Scient: esp. as i believe a ternary operator is not a solution there, something else is. maybe reading about decorators/presenters/helpers a little more?
[07:27:58] k3rn31: has joined #RubyOnRails
[07:27:58] jbermudes: has joined #RubyOnRails
[07:27:58] jbermudes: has joined #RubyOnRails
[07:28:03] sevenseacat: or just use a polymorphic route
[07:28:26] Scient: or that, even better
[07:28:34] pawnbox: has joined #RubyOnRails
[07:28:36] elomatreb: I agree on not having to be talking documentation as a user in this channel, but telling them to use documentation can be done in a friendly, non-hostile way
[07:28:47] dminuoso: Scient: So, his initial question was "how to use less code". The only logical solution to the immediate question is to use a ternary operator. If you had cared to read beyond my initial line, you would have noticed I also recommended presenters/decorators.
[07:28:59] rvanlieshout: elomatreb: but that's just because it's been told over and over again
[07:29:02] dminuoso: Scient: And calling whatever I say shit, but recommending helpers is hilarious in itself.
[07:29:14] sevenseacat: dminuoso: careful when talking about absolutes like 'the ONLY logical solution'
[07:29:24] dminuoso: sevenseacat: You are right.
[07:29:29] Scient: i also actually think most presenters/decorators are shit personally :P
[07:29:33] Scient: but i know people like to use them
[07:29:44] elomatreb: rvanlieshout: Honestly? Doesn't matter. Tell him in a friendly way to use the documentation, if they don't, just ignore them
[07:29:52] Scient: (thats why i like the polymorphic route solution too)
[07:30:40] elomatreb: I'm sorry I have to play the language cop, but I've seen too many people being turned away from OSS by the hostile attitudes
[07:30:53] rvanlieshout: elomatreb: imho it does matter
[07:31:05] dminuoso: elomatreb: If it removes some of the grossly incompetent people, I'm down for it.
[07:31:24] sevenseacat: elomatreb: most of what you're saying is in the channel rules, btw, but there is only so many times you can politely point the same person to basic documentation, especially for long-term users
[07:31:46] Scient: sevenseacat: go read a rails book! pref. the one you helped to write!
[07:41:11] finnnnnnnnnnn: has joined #RubyOnRails
[07:46:23] tercenya: has joined #RubyOnRails
[07:47:13] jenrzzz: has joined #RubyOnRails
[07:52:52] AimlessRAven: ok but how to return link when i user teranity operator
[07:52:53] AimlessRAven: %li = current_admin.has_role?(:corporate) ? "#{link_to "asd"}" : "normal"
[07:52:56] AimlessRAven: for example ..
[07:53:17] universa1: AimlessRaven: do not wrap it in a string.
[07:53:30] universa1: AimlessRaven: or use the explicit if else form.
[07:54:42] AimlessRAven: universa1 i whot to do with teranity
[07:54:48] AimlessRAven: but if i not user "" string wrapper
[07:55:07] AimlessRAven: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' ...s_role?(:corporate) ? link_to "asd" ... ^
[07:55:36] deur-: do what the error says, use parenthesis for the link_to method
[07:55:41] deur-: link_to("asd)
[07:57:42] pydave6367: has joined #RubyOnRails
[08:01:01] mark_66: has joined #RubyOnRails
[08:01:02] yfeldblum: has joined #RubyOnRails
[08:01:25] xibalba: has joined #RubyOnRails
[08:04:35] rrawlins: has joined #RubyOnRails
[08:06:43] roshanavand: has joined #RubyOnRails
[08:07:57] adre: has joined #RubyOnRails
[08:08:03] srinidhi: has joined #RubyOnRails
[08:09:46] moeabdol: has joined #RubyOnRails
[08:10:18] watersoul_: has joined #RubyOnRails
[08:10:32] jacobat_: has joined #RubyOnRails
[08:11:14] Palsson: has joined #RubyOnRails
[08:11:22] machuga_: has joined #RubyOnRails
[08:12:03] blackmesa: has joined #RubyOnRails
[08:12:38] mattwithoos: has joined #RubyOnRails
[08:12:41] loglaunch: has joined #RubyOnRails
[08:12:41] Kuukunen: has joined #RubyOnRails
[08:12:53] jenrzzz: has joined #RubyOnRails
[08:13:22] douglascorrea: has joined #RubyOnRails
[08:14:06] hfp_work: has joined #RubyOnRails
[08:14:10] Trynemjoel: has joined #RubyOnRails
[08:14:19] llakey: has joined #RubyOnRails
[08:14:19] ur5us: has joined #RubyOnRails
[08:15:31] rubyonrails545: has joined #RubyOnRails
[08:15:36] phrozen77: has joined #RubyOnRails
[08:16:06] AntiSpamMeta: has joined #RubyOnRails
[08:16:30] cZk: has joined #RubyOnRails
[08:18:42] slash_nick: has joined #RubyOnRails
[08:20:44] arup_r: has joined #RubyOnRails
[08:22:01] pawnbox: has joined #RubyOnRails
[08:23:08] wethu: has joined #RubyOnRails
[08:23:32] dminuoso_: has joined #RubyOnRails
[08:23:35] armyriad: has joined #RubyOnRails
[08:25:37] roshanavnad_: has joined #RubyOnRails
[08:26:15] pickandmix: has joined #RubyOnRails
[08:28:22] Dbugger: I have a problem. I am reading here(http://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_back) and it seems like there is a method called "redirect_back" but when I use it on my controller I get this error. "undefined method `redirect_back'". What is going on??
[08:28:51] sevenseacat: what version of rails are you using?
[08:29:26] sevenseacat: if its not 5, you're out of luck and should be using redirect_to :back
[08:30:10] Dbugger: Rails -v gives me 4.2.1
[08:30:23] Dbugger: I forgot R5 was out...
[08:30:38] sevenseacat: and you're looking at the docs for 5
[08:30:38] Dbugger: What would be then the alternative to have a fallback, when :back has no referer?
[08:31:36] sevenseacat: http://stackoverflow.com/questions/771656/correctly-doing-redirect-to-back-in-ruby-on-rails-when-referrer-is-not-availabl
[08:32:11] armyriad: has joined #RubyOnRails
[08:32:22] Dbugger: I read that, but then it said: "If you do this often (which I think is a bad idea)... "
[08:32:33] arBmind: has joined #RubyOnRails
[08:32:35] Dbugger: then i do not get why it recommends a solution that he thinks its bad
[08:32:45] sevenseacat: it is, because "back" is usually used in the context of redirecting after form posts, when "back" could just be the form itself
[08:33:18] conta: has joined #RubyOnRails
[08:35:11] Dbugger: What I would like is "redirect back or go to root"
[08:36:12] sevenseacat: I would write your own helper method to store the correct "back" path and then use it if set
[08:36:30] sevenseacat: much like gems like devise use a stored location when redirecting to sign in
[08:38:12] Dbugger: I like this solution I just found: http://blog.bigbinary.com/2016/02/29/rails-5-improves-redirect_to_back-with-redirect-back.html
[08:39:17] sevenseacat: which is also in the SO question I linked...
[08:39:33] Dbugger: Probably that is where I clicked it :D
[08:39:42] Dbugger: Thank you, sevenseacat :)
[08:39:46] abhinavmehta: I'm getting following error on assets precompile - https://thepb.in/p/qjhLyDgp26ZHB
[08:40:07] abhinavmehta: I'm currently migrating Rails 3.1 project to 4.2.7
[08:40:49] universa1: abhinavmehta: https://thepb.in/p/qjhLyDgp26ZHB#L6 -- there shouldn't be too many ` in your project.
[08:40:54] abhinavmehta: it was working fine with Rails 3.1 so I assume it's not a code/syntax issue, its more of integration issue.
[08:41:33] abhinavmehta: universa1: yes I agree, it shouldn't be too many.
[08:41:42] universa1: abhinavmehta: so search for them?
[08:42:03] universa1: abhinavmehta: and also to make sure it is really an assets problem: run rake assets:precompile
[08:42:16] universa1: just make sure you clean out public/assets afterwards.
[08:42:37] abhinavmehta: universa1: I ran assets:precompile with --trace but it doesn't give details/specifics which file causing the issue.
[08:43:06] universa1: abhinavmehta: well the error you posted does not like from assets:precompile
[08:43:09] abhinavmehta: universa1: and surprsingly when I run rails-server and try to load a page, it stucks at image_tag
[08:43:48] abhinavmehta: universa1: yes its not from assets:precompile, let me share assets:precompile log.
[08:44:16] universa1: gtg, bbl :-)
[08:44:35] abhinavmehta: https://thepb.in/p/BghPX1xWD4yTY assets:precompile log
[08:45:58] yardenbar: has joined #RubyOnRails
[08:47:44] armyriad: has joined #RubyOnRails
[08:48:42] Contigi: has joined #RubyOnRails
[08:52:09] workmad3: has joined #RubyOnRails
[08:56:20] blackmesa: has joined #RubyOnRails
[09:00:51] DoubleMalt: has joined #RubyOnRails
[09:02:02] armyriad: has joined #RubyOnRails
[09:03:38] marr: has joined #RubyOnRails
[09:04:42] zacts: has joined #RubyOnRails
[09:07:28] abhinavmehta: In my Rails-app, everywhere image_tag, javascript_include_tag and stylesheet_link_tag are causing ExecJS::ProgramError issue like this - https://someimage.com/GSAhCoI
[09:07:38] abhinavmehta: I'm on Rails 4.2.7
[09:08:13] abhinavmehta: anyone has any clue, what I'm doing wrong?
[09:09:34] sevenseacat: abhinavmehta: can you gist the error you're seeing?
[09:10:17] abhinavmehta: sure, here it is https://thepb.in/p/lOhOwyWY99kiB
[09:10:25] sevenseacat: thats not a gist.
[09:10:29] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:11:20] abhinavmehta: pardon but I'm not sure, what's the difference, but here it is - https://gist.github.com/mehta/d42de4627d32ddf909ba00aef5d4fece
[09:11:57] sevenseacat: thats the exact same error universal helped you with
[09:12:03] sevenseacat: did you search for that character yet?
[09:12:03] Ergo: has joined #RubyOnRails
[09:12:10] blackhuey: has joined #RubyOnRails
[09:12:32] abhinavmehta: universal said find this character in that file .. actually that doesn't help.
[09:12:36] armyriad: has joined #RubyOnRails
[09:12:39] abhinavmehta: because there is no such character in that file
[09:13:04] sevenseacat: > there shouldn't be too many ` in your project.
[09:13:05] abhinavmehta: secondly - at many places I'm using these image/js/css tags, all of them causing issue across all partials etc.
[09:13:09] sevenseacat: did you search in your project?
[09:13:21] abhinavmehta: just a sec. please hear me..
[09:13:27] snowy: has joined #RubyOnRails
[09:14:00] abhinavmehta: and if I remove all image/js/css include tags in such layouts/partials it works perfectly fine .. so the point is there is something wrong with these tags and not with '`' character
[09:14:00] tennis: has joined #RubyOnRails
[09:14:11] abhinavmehta: because that doesn't exists.
[09:14:14] sevenseacat: so the error is lying? good luck
[09:14:56] abhinavmehta: I'm also surprised, but sort of yes. It may not be lying but something else is broken which might be relaying this error.
[09:15:21] AimlessRAven: is rails have parentheses helper
[09:15:33] AimlessRAven: to not user "(#{..})"
[09:15:41] sevenseacat: AimlessRaven: no.
[09:15:52] rafaelfranca: has joined #RubyOnRails
[09:16:03] sevenseacat: AimlessRaven: a quick google search would have answered that.
[09:16:15] abhinavmehta: I'm unable to figure out where exactly the issue is.. else how come removing all image/js/css tags makes everything fine.
[09:16:28] abhinavmehta: and please note - forget about js/css tags, even image-tags causing issue.
[09:16:56] sevenseacat: abhinavmehta: I don't think anyone is going to help you if you insist the error is not relevant to the problem.
[09:17:03] abhinavmehta: there is no image compilation/optimization/conversion etc. so why image_tag causing any issue .. you can't put '`' in image.
[09:17:58] abhinavmehta: sevenseacat: I didn't mean it that way. I'm just requesting to please look it other way.
[09:18:36] abhinavmehta: or provide me any pointer to look-up for to read further if I'm ignorant.
[09:20:54] pawnbox: has joined #RubyOnRails
[09:20:57] wethu: has joined #RubyOnRails
[09:21:09] tercenya: has joined #RubyOnRails
[09:22:03] armyriad: has joined #RubyOnRails
[09:23:06] lxsameer: has joined #RubyOnRails
[09:34:31] roamingdog: has joined #RubyOnRails
[09:37:51] spion: has joined #RubyOnRails
[09:38:40] universa1: abhinavmehta: tried reducing your application.js ?
[09:40:01] pawnbox: has joined #RubyOnRails
[09:41:06] beilabs: has joined #RubyOnRails
[09:56:05] dionysus69: has joined #RubyOnRails
[09:58:51] pawnbox: has joined #RubyOnRails
[09:59:11] arup_r: has joined #RubyOnRails
[10:00:35] AimlessRAven: someone know why here
[10:00:36] AimlessRAven: https://gist.github.com/anonymous/291568686e396eaee472c0aab80163a5
[10:00:44] AimlessRAven: my method dont update my label class
[10:00:57] universa1: AimlessRaven: !gist-usage --- seriously.
[10:00:57] helpa: AimlessRaven: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[10:01:22] universa1: AimlessRaven: case for a true false?!
[10:01:33] universa1: AimlessRaven: if product.active? ... else ... end ...
[10:02:04] rvanlieshout: AimlessRaven: just curious, why don't you feel any urge to invest some time to learn?
[10:02:24] universa1: AimlessRaven: and then product.active? does not return 'false' or 'true', but true or false most likely
[10:02:31] universa1: 'false' is not false!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[10:02:59] AimlessRAven: universa1: yeah.. its work with if statement
[10:03:23] universa1: AimlessRaven: you should invest time to understand why your old code did not work!
[10:03:31] universa1: there is so much wrong with so little...
[10:04:39] AimlessRAven: yeas your right here
[10:04:41] harfangk: has joined #RubyOnRails
[10:04:57] AimlessRAven: but because my case statement dont return me true or false
[10:05:23] tbuehlmann: 'And all those exclamation marks, you notice? Sixtyfive? A sure sign of someone who wears his underpants on his head.'
[10:05:43] universa1: tbuehlmann: <3 ;)
[10:06:19] c355E3B: has joined #RubyOnRails
[10:06:28] fox_mulder_cp: hi. how to in migration file set up a default value for datetime by current datetimt
[10:06:46] fox_mulder_cp: when model instance created
[10:07:07] fox_mulder_cp: such as timestamps
[10:07:16] tbuehlmann: fox_mulder_cp: iirc, that's not possible in a migration, you'll have to do that in your model
[10:07:28] fox_mulder_cp: tbuehlmann: thanks
[10:07:56] tbuehlmann: have a look at the #after_initialize method
[10:08:24] universa1: fox_mulder_cp: created_at ?
[10:08:50] fox_mulder_cp: universa1: hm, it's a good point too
[10:09:18] fox_mulder_cp: dublucate date - bad way
[10:09:36] Hyuk: has joined #RubyOnRails
[10:09:52] roamingdog: fox_mulder_cp: well do you want it to be just like created_at or do you want some other event's date to be kept with the model?
[10:10:29] fox_mulder_cp: universa1: i don't need datetime field, when it added bu timestamps
[10:11:26] universa1: fox_mulder_cp: those contain essentially the same information? what are you trying to do?
[10:11:34] tercenya: has joined #RubyOnRails
[10:11:38] fox_mulder_cp: what is it? WARN: Unresolved specs during Gem::Specification.reset: redis (>= 3.0.4, ~> 3.0)
[10:12:33] fox_mulder_cp: universa1: add 'event' model to my app, for generate 'log' of users' activity - such as application created, stopped, domain resource records updated, etc
[10:12:52] universa1: fox_mulder_cp: so created_at has the information you want.
[10:13:07] beilabs: has joined #RubyOnRails
[10:13:13] baash05: has joined #RubyOnRails
[10:13:23] universa1: fox_mulder_cp: the time and that event happened.
[10:13:28] universa1: *time and date
[10:13:31] fox_mulder_cp: yes, i know, i forgot it
[10:13:45] tbuehlmann: I personally wouldn't take created_at for that
[10:14:02] fox_mulder_cp: tbuehlmann: why?
[10:14:21] tbuehlmann: what if you have to add an event later on? would you change created_at to match the correct time?
[10:15:18] sevenseacat: why do events all have to have the same time?
[10:15:38] fox_mulder_cp: tbuehlmann: it's only generated by app event, when user press 'stop app' btn, or etc, user can't add events manually
[10:15:39] roamingdog: fox_mulder_cp: if you're tracking several event's times, yes you'll need several different datetime fields
[10:15:46] harfangk: has joined #RubyOnRails
[10:15:56] benlieb: has joined #RubyOnRails
[10:17:03] fox_mulder_cp: it's like facebook 'user comment your post' style
[10:17:12] bronson: has joined #RubyOnRails
[10:17:51] fox_mulder_cp: not as 'new museum opens at weekend, go to it with $users'
[10:18:32] roamingdog: well that clears it up
[10:19:43] tbuehlmann: created_at is for the fact when the record was created, that'll normally represent what you want it to represent. but that's not always the case with events. I'd rather have a published_at/occured_at or similar named column
[10:19:44] fox_mulder_cp: but i have a qa about i18n of my messages for this eventlog
[10:19:58] Kedare: has joined #RubyOnRails
[10:20:31] rickmasta: has joined #RubyOnRails
[10:20:31] epochwolf: has joined #RubyOnRails
[10:20:51] fox_mulder_cp: make a different model with events-types and get messages from it with i18n keys from my i18n yaml's files>
[10:21:09] Diabolik: any help on this would be much appreciated: http://stackoverflow.com/questions/38523979/rails-simple-form-select-box-appearing-twice-on-validation-eerror
[10:21:18] qejk: has joined #RubyOnRails
[10:21:29] dionysus69: hello, I am getting this when i start rails server. https://gist.github.com/webzorg/25038c23f06f98bcfb5df2b6807a55e0 I updated from changed Gemfile from rails 5 RC to ~> rails 5. Should I care about this?
[10:22:04] fox_mulder_cp: Please register a mime type using `register_mime_type` then
[10:22:04] fox_mulder_cp: 16 use `register_compressor` or `register_transformer`.
[10:22:07] sevenseacat: Diabolik: what select box? there's a shitload of code there
[10:22:24] sevenseacat: Diabolik: whats the generated HTML?
[10:22:28] yfeldblum: has joined #RubyOnRails
[10:23:09] Diabolik: the f.association in the look_book_image_product_fields partial
[10:23:13] Diabolik: generated HTML looks fine
[10:23:17] Diabolik: it just keeps doubling each time
[10:23:24] sevenseacat: if the generated HTML is fine, then nothing is being doubled
[10:23:36] sevenseacat: please show the generated HTML with a specific problem
[10:23:53] dionysus69: fox_mulder_cp: what do you mean, where should I "register mime_type" ?
[10:23:54] tercenya: has joined #RubyOnRails
[10:24:19] Diabolik: sevenseacat 2 secs
[10:24:21] Diabolik: https://www.dropbox.com/s/qout2612ksyex1n/Screenshot%202016-07-22%2011.24.10.png?dl=0
[10:24:24] Diabolik: thats the screen shot
[10:24:26] Diabolik: gisting the html
[10:24:27] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:24:51] sevenseacat: unless its a CSS issue, screenshots aren't relevant
[10:25:41] universa1: Diabolik: in your create method, why are you passing the parameters to build, and then set them again directly below?
[10:25:41] Diabolik: https://gist.github.com/askl56/7b9d959c450518db0c7e5d32db39628f
[10:26:27] sevenseacat: so you have two products there
[10:26:55] Diabolik: thank you so much
[10:27:01] Diabolik: had a brain fart :(
[10:27:08] Diabolik: thanks sevenseacat as well
[10:28:15] asianMike: has joined #RubyOnRails
[10:31:11] fox_mulder_cp: and how to create event model with default i18n support.. add's a field for key, and search for key in i18n yaml's ?
[10:33:55] quazimodo: has joined #RubyOnRails
[10:33:55] quazimod1: has joined #RubyOnRails
[10:34:14] tercenya: has joined #RubyOnRails
[10:34:47] yardenbar: has joined #RubyOnRails
[10:35:14] srinidhi: has joined #RubyOnRails
[10:36:22] moep: has joined #RubyOnRails
[10:37:52] Detch: has joined #RubyOnRails
[10:40:43] arup_r: has joined #RubyOnRails
[10:42:54] moeabdol: has joined #RubyOnRails
[10:43:13] armyriad: has joined #RubyOnRails
[10:43:26] abhinav: has joined #RubyOnRails
[10:43:54] dotty: has joined #RubyOnRails
[10:45:12] epitron: has joined #RubyOnRails
[10:45:54] dotty: Hi everyone. Since upgrading to Rails 5, I've found that emails from devise are ignoring the default_url_options (and failing, as a result, with "Missing host to link to!"). Anyone else seeing this?
[10:48:47] roamingdog: dotty: in case it helps, i had similar issue, possible when moving to rails 5 - turned out an initializer (for carrierwave) was setting my default_url_options and I had to add a line like: unless ['development', 'test'].include? Rails.env to it
[10:49:12] dotty: Oh, I'm using CarrierWave, that could be it. Thanks roamingdog, will take a look
[10:49:29] fox_mulder_cp: dotty: u sey about config.action_mailer.default_url_options = { host: 'domain.com' } ?
[10:50:18] dotty: fox_mulder_cp: that's right, I've set that in my development.rb but it's being ignored
[10:50:52] Velizar: has joined #RubyOnRails
[10:51:34] AimlessRAven: http://fontawesome.io/icon/percent/ i have font-awesome-sass version: 4.6.2 but my percent icont dont appear
[10:51:43] AimlessRAven: any other icons is appear but this isnot
[10:52:24] MaDErroR123: has joined #RubyOnRails
[10:53:06] contradictioned: has joined #RubyOnRails
[10:53:50] roamingdog: AimlessRaven: how is that rails-related?
[10:54:00] AntiSpamMeta: has joined #RubyOnRails
[10:54:21] fox_mulder_cp: AimlessRaven: <i class='fa fa-percent'></i> ?
[10:54:49] AimlessRAven: fox_mulder_cp: exacly but dont appear
[10:54:54] AimlessRAven: i dont have font-awesome-rails gem
[10:54:58] AimlessRAven: is this can be the wrong
[10:55:07] AimlessRAven: i have only font-awesome-sass
[10:55:44] rvanlieshout: AimlessRaven: and added stuff to your application.scss?
[10:55:56] AimlessRAven: rvanlieshout: yeah
[10:56:06] rvanlieshout: show that you care
[10:56:08] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:56:12] rvanlieshout: a proper gist
[10:57:13] srinidhi: has joined #RubyOnRails
[10:58:56] AimlessRAven: https://gist.github.com/anonymous/adae68aadd0b9462bc0e9d69b6478de2
[10:58:58] AimlessRAven: here is the code
[11:00:28] abhinavmehta: universa1: I zeroed(emptied) the complete application.js & application.css, even after that I'm getting same error.
[11:00:49] rvanlieshout: AimlessRaven: what version of that gem?
[11:01:27] abhinavmehta: (repeating for reference) error is - https://thepb.in/p/lOhOwyWY99kiB
[11:01:54] abhinavmehta: and it's with image_tag - https://someimage.com/GSAhCoI
[11:02:19] doodlehaus: has joined #RubyOnRails
[11:03:43] AimlessRAven: rvanlieshout: 2.6.4 is my gem version
[11:04:18] AimlessRAven: rvanlieshout: is the problem can be my font-awesome-rails gem... i not add it to my gemfile
[11:04:50] rvanlieshout: what version of font awesome introduced that percent icon?
[11:05:48] AimlessRAven: idk, but i suggest the latest :) i just add latest version
[11:06:23] AimlessRAven: i go smoke 1 ciggarete and come back
[11:06:34] abhinavmehta: rvanlieshout: do you have any thoughts on my problem statement?
[11:06:51] rvanlieshout: abhinavmehta: i wasn't reading along. let me catch up a bit
[11:07:38] rvanlieshout: you've got the full stack trace nearby?
[11:07:53] abhinavmehta: yes I can provide you full stack trace.
[11:07:55] abhinavmehta: give me a sec.
[11:09:35] abhinavmehta: https://thepb.in/p/xGhm5ykAPn5cM full stack trace taken from browser
[11:09:55] abhinavmehta: https://thepb.in/p/nZhlZzvokZjcY full stack trace take from rails server console.
[11:10:10] abhinavmehta: provided you both, whichever you like for same request.
[11:10:31] rvanlieshout: the error seems to be on line 14 of your home.slim
[11:10:34] rvanlieshout: stylesheet-link_tag
[11:10:36] kiddorails: has joined #RubyOnRails
[11:11:03] abhinavmehta: that's right, if you see it that way.
[11:11:12] abhinavmehta: but on browser it shows image-tag issue https://someimage.com/GSAhCoI
[11:11:23] mdw: has joined #RubyOnRails
[11:11:25] rvanlieshout: yeah. so that's weird. does it happen if you empty your stylesheet?
[11:11:48] abhinavmehta: yes, styles are emtpied
[11:11:56] abhinavmehta: javascript is emtied
[11:12:01] rvanlieshout: javascript can be present
[11:12:10] rvanlieshout: and if we comment line 14 of that layout file?
[11:12:11] abhinavmehta: issue is js/css/image tag are not working and causing issue.
[11:12:14] yoongkang: has joined #RubyOnRails
[11:12:43] rvanlieshout: but even the partial stack of that image_tag leads to something else
[11:12:47] abhinavmehta: if we comment line#14 it goes to next js/css/image tag and cause same issue and keep repeating last tag in the flow
[11:12:53] alfiemax: has joined #RubyOnRails
[11:13:14] rvanlieshout: is that an assumption or you've already tried that?
[11:13:20] pawnbox: has joined #RubyOnRails
[11:13:25] abhinavmehta: and I remove/comment all js/css/image tag then I get the page right.
[11:13:42] rvanlieshout: so it fails if you include just any
[11:13:47] abhinavmehta: no acutally I tried and seen the page getting loaded after removing all of them
[11:13:54] abhinavmehta: yes that's right.
[11:14:02] rvanlieshout: could we try with only that css removed?
[11:14:21] abhinavmehta: yes I tried, and let me share you what happens if I remove line#14
[11:14:59] armyriad: has joined #RubyOnRails
[11:15:05] abhinavmehta: https://thepb.in/p/qjhLyDZMRQqCB from browser
[11:15:13] yardenbar: has joined #RubyOnRails
[11:15:22] abhinavmehta: https://thepb.in/p/mwh1oZzQDOBs5 from rails console
[11:15:44] rvanlieshout: and what's in app/extensions/controllers/app_base.rb:23:in `block (2 levels) in <module:AppBase>' ?
[11:16:26] roamingdog: has joined #RubyOnRails
[11:17:15] abhinavmehta: https://thepb.in/p/j2hl42NMmm0fP - app/extensions/controllers/app_base
[11:18:02] abhinavmehta: please note the above app_base.rb line#11 is line#23 you reading.
[11:18:18] abhinavmehta: I removed some commented licence/company information.
[11:18:18] rvanlieshout: could we remove that block just to get a cleaner stack trace?
[11:18:48] abhinavmehta: which block you are talking to remove?
[11:18:57] abhinavmehta: around_filter in app_base.rb?
[11:19:23] abhinavmehta: ok, give me a min
[11:20:31] abhinavmehta: after removing that around_filter block, issue still persists and here is the stacktrace
[11:20:50] abhinavmehta: https://thepb.in/p/r0hwRpJrxXVsK from browser
[11:21:06] abhinavmehta: https://thepb.in/p/NxhVqAyZlxXSN from rails server console logs
[11:21:22] alfiemax: is there a list of all valid timezones available in rails
[11:21:42] rvanlieshout: in what env is this app running?
[11:21:59] rvanlieshout: alfiemax: all that are valid on your server, there is a rake (or rails (for version 5)) task for it
[11:22:15] abhinavmehta: Currently this app is running perfectly in development, staging and production using Rails 3.1
[11:22:28] abhinavmehta: now I'm porting it to Rails 4.2.7 with ruby 2.3.1
[11:22:54] rvanlieshout: and the output i get here is from running in production?
[11:22:56] abhinavmehta: here is where, I'm sort of stuck with this issue.
[11:23:11] rvanlieshout: also edit https://github.com/lautis/uglifier/blob/master/lib/uglifier.rb#L161 (use bundle show uglifier to get the path to that gem)
[11:23:12] abhinavmehta: nope its from development.
[11:23:12] yoongkang: has joined #RubyOnRails
[11:23:14] sevenseacat: I really hope you're doing that upgrade in steps
[11:23:15] tercenya: has joined #RubyOnRails
[11:23:16] srinidhi1: has joined #RubyOnRails
[11:23:21] rvanlieshout: and have it puts the params
[11:23:25] rvanlieshout: to see what it's even trying to compile
[11:23:26] sevenseacat: ie. to Rails 3.2, 4.0, 4.1, 4.2...
[11:24:30] rvanlieshout: + following upgrade instructions
[11:24:44] alfiemax: rvanlieshout, will all timezones work with `in_time_zone` method for datetime
[11:24:55] rvanlieshout: alfiemax: iirc yes
[11:25:11] abhinavmehta: you mean I should put a print/puts line in uglifier.rb and should see what is the value of 'input' variable, right?
[11:25:24] rvanlieshout: abhinavmehta: yes
[11:25:44] abhinavmehta: sevenseacat: Actually I'm jumping and not upgrading it in the manner like Rails 3.2, 4.0, 4.1, 4.2...
[11:25:53] alfiemax: rvanlieshout, thanks :)
[11:25:55] sevenseacat: abhinavmehta: thats a foolish idea.
[11:26:22] sevenseacat: because every single one of those versions in the middle has breaking changes
[11:26:42] sevenseacat: and every single one of those versions will depend on different versions of all your dependencies
[11:27:08] abhinavmehta: sevenseacat: I'll start again, if I fail in this attempt .. the reason is if I do it that way, it would need multiple rounds of testing and currently we are low on QA.
[11:27:22] abhinavmehta: and hence the overall migration will take a lot longer then we could afford.
[11:27:57] abhinavmehta: rvanlieshout: I'm printing those params in uglifier, please give me a min.
[11:28:08] rodfersou: has joined #RubyOnRails
[11:28:23] abhinavmehta: rvanlieshout: but just curious since we emptied the js and css then what uglfier will be doing in this.
[11:29:07] workmad3: abhinavmehta: even if you don't release intermediate version upgrades, I'd highly recommend that you upgrade one version at a time
[11:29:16] abhinavmehta: right now the problem boils down to image_tag and more importantly to include tag, right?
[11:30:01] workmad3: abhinavmehta: just do it locally, follow the upgrade instructions for each version to the next, sanity check and then move on to the next one without a QA cycle... end result will likely be a much less problematic upgrade for you, and only one QA cycle
[11:30:31] abhinavmehta: workmad3: sounds right to me.
[11:31:10] abhinavmehta: but since I've done quite a work, hence would like to spend a little bit of time more to see if this works else I'll follow the approach you suggested.
[11:32:37] workmad3: mmm, sunk cost fallacy... hope it works out for you :)
[11:33:14] sevenseacat: you have no idea how close you are to done
[11:34:00] roamingdog: has joined #RubyOnRails
[11:34:33] jarred: has joined #RubyOnRails
[11:35:55] FLeiXiuS: has joined #RubyOnRails
[11:36:27] FLeiXiuS: Is this still accurate regarding hidden fields and nested attributs? http://rubyflare.tumblr.com/post/54967114271/hidden-fields-generated-by-fieldsfor-helper
[11:37:11] oleksandriuzikov: has joined #RubyOnRails
[11:37:11] FLeiXiuS: I think I'm asking the wrong question.
[11:37:36] sevenseacat: i dont even know what that post is saying
[11:38:03] moeabdol: has joined #RubyOnRails
[11:38:20] abhinavmehta: rvanlieshout: actually something starts working.
[11:38:38] beilabs: has joined #RubyOnRails
[11:38:43] lacce: has joined #RubyOnRails
[11:38:47] tercenya: has joined #RubyOnRails
[11:39:01] mdw: has joined #RubyOnRails
[11:39:02] abhinavmehta: I'm check if I could fix things now would revert shortly if it works and to say thanks.
[11:39:47] FLeiXiuS: sevenseacat, With nested attributes, rails is automatically adds the ID mappings when using fields_for. Yay for reading the docs.
[11:39:56] mdw: has joined #RubyOnRails
[11:40:01] FLeiXiuS: Wow that grammar.
[11:40:20] abhinavmehta: rvanlieshout: the change I did is, in applicaiton.rb we have included few more js directly(using config.assets.precompile) and I removed them too and image_tag starts working.
[11:40:32] FLeiXiuS: I needed it to *not* do that as it's generated them in the wrong place.
[11:41:00] ldnunes: has joined #RubyOnRails
[11:41:06] mdw: has joined #RubyOnRails
[11:41:06] rvanlieshout: abhinavmehta: happy to hear that
[11:41:18] sevenseacat: it generates them inside the fields_for
[11:42:00] mdw: has joined #RubyOnRails
[11:42:08] FLeiXiuS: I have my nested attributes separated by containers in HTML. The fields_for was creating inputs outside of the container and it was breaking a few plugins.
[11:42:10] abhinavmehta: rvanlieshout: thanks friend, your uglifier suggestion gave me the pointers.
[11:42:20] rvanlieshout: you're welcome
[11:42:42] MaDErroR123: has joined #RubyOnRails
[11:46:46] beilabs: has joined #RubyOnRails
[11:49:03] danman: has joined #RubyOnRails
[11:49:48] pawnbox: has joined #RubyOnRails
[11:50:43] tercenya: has joined #RubyOnRails
[11:55:37] ur5us: has joined #RubyOnRails
[12:02:20] bbrowning: has joined #RubyOnRails
[12:06:20] jenrzzz: has joined #RubyOnRails
[12:11:59] maucar: has joined #RubyOnRails
[12:12:37] Mia: has joined #RubyOnRails
[12:12:37] Mia: has joined #RubyOnRails
[12:12:50] dminuoso_: /join #english
[12:13:41] oystersauce8: has joined #RubyOnRails
[12:13:58] cd-rum: has joined #RubyOnRails
[12:16:50] cd-rum_: has joined #RubyOnRails
[12:17:03] yoongkang: has joined #RubyOnRails
[12:24:32] Ergo: has joined #RubyOnRails
[12:26:55] Rodya_: has joined #RubyOnRails
[12:27:44] King_Rex: has joined #RubyOnRails
[12:29:37] SteenJobs: has joined #RubyOnRails
[12:30:52] rickmasta: has joined #RubyOnRails
[12:31:18] Pazician: has joined #RubyOnRails
[12:31:18] Pazician: has joined #RubyOnRails
[12:31:19] Axilla: has joined #RubyOnRails
[12:31:33] ElFerna: has joined #RubyOnRails
[12:33:09] SteenJobs: has joined #RubyOnRails
[12:34:12] nertzy: has joined #RubyOnRails
[12:37:36] abhinavmehta: In RoR 3.1 we created a app/extensions folder, which contains some code and could be used at multiple places in app/controllers, app/models etc.
[12:38:08] abhinavmehta: Now after porting to RoR 4.2.7 those models and controllers are unable to load/link those extensions.
[12:38:26] abhinavmehta: If I do include Module:Submodule, then it works
[12:38:40] abhinavmehta: ^ include in rails console
[12:38:56] abhinavmehta: module is being loaded and no error.
[12:39:02] pawnbox: has joined #RubyOnRails
[12:39:54] abhinavmehta: but if that is written in model/controller file and being loaded by rails-server then it throws no error but it actually doesn't load/include that code.
[12:40:31] pydave6367: has joined #RubyOnRails
[12:40:41] pawnbox: has joined #RubyOnRails
[12:41:11] abhinavmehta: actually include call doesn't throw any error, but in-reality the module is not loaded or available in the runtime.
[12:41:36] roamingdog: has joined #RubyOnRails
[12:41:38] DaniG2k: has joined #RubyOnRails
[12:41:45] beilabs: has joined #RubyOnRails
[12:43:08] DaniG2k: I'm trying to set up a Rails dev environment locally. I was told to use Dnsmasq so that all .dev urls will send 127.0.01 in response to that request. Does anyone have experience using Dnsmasq here? I am following this guide https://passingcuriosity.com/2013/dnsmasq-dev-osx/ but when I dig testing.testing.one.two.three.dev @127.0.0.1 I am getting an error
[12:43:29] DaniG2k: namely ;; connection timed out; no servers could be reached
[12:43:31] abhinavmehta: use unbound, better then DNSmasq
[12:43:43] abhinavmehta: and also use hotel.dev
[12:44:07] abhinavmehta: https://github.com/typicode/hotel
[12:44:41] workmad3: has joined #RubyOnRails
[12:44:46] tvw: has joined #RubyOnRails
[12:44:46] jgoulah: has joined #RubyOnRails
[12:44:55] abhinavmehta: DaniG2k: for time being put these entries in your /etc/hosts and make it work.
[12:45:52] mdw7: has joined #RubyOnRails
[12:46:19] DaniG2k: thanks for the tips
[12:46:22] DaniG2k: will look into hotel later
[12:46:47] mdw7: has joined #RubyOnRails
[12:47:26] eljimbo: has joined #RubyOnRails
[12:48:39] hanwei_: has joined #RubyOnRails
[12:49:09] wd40s: has joined #RubyOnRails
[12:50:04] DaniG2k: also, the instructions say to use foreman start....is this common for rails production?
[12:50:16] DaniG2k: i mean, to mimick a production server locally?
[12:50:36] SteenJobs: has joined #RubyOnRails
[12:51:12] renegadeandy: has joined #RubyOnRails
[12:52:07] arup_r: has joined #RubyOnRails
[12:52:18] conta: guys, anyone knows good article on heroku and assets? I am not any good with assets and I have app that do some precompile. I am moving it to heroku
[12:54:38] DaniG2k_: has joined #RubyOnRails
[12:55:35] dunpeal: has joined #RubyOnRails
[12:56:31] dunpeal: Hi. I'd like to write a maintenance script for a Rails app that has to require one model, and only that model. I'm trying to avoid loading the entire Rails stack, since that takes a very long time. How do I do that?
[12:59:18] renegadeandy: has left #RubyOnRails: ()
[12:59:20] siaw23: has joined #RubyOnRails
[12:59:50] tildes: has joined #RubyOnRails
[12:59:53] siaw23: maybe someone knows rails and react and wants to help? http://stackoverflow.com/questions/38411542/submitting-a-form-to-rails-with-reactjs
[13:01:41] hanwei_: has joined #RubyOnRails
[13:05:26] ramortegui: has joined #RubyOnRails
[13:08:00] jenrzzz: has joined #RubyOnRails
[13:08:13] ElFerna: has joined #RubyOnRails
[13:08:25] snowy: has joined #RubyOnRails
[13:09:01] Rodya_: has joined #RubyOnRails
[13:11:35] Oliphaunte: has joined #RubyOnRails
[13:12:38] matthewd: dunpeal: require 'path/to/your/model' ?
[13:13:40] dionysus69: has joined #RubyOnRails
[13:17:29] benlieb: has joined #RubyOnRails
[13:18:15] aegis3121: has joined #RubyOnRails
[13:19:26] openstruct: has joined #RubyOnRails
[13:20:39] openstruct: This might be obvious...I'm implementing a Rails engine and for rails app to mount it, I assume both the engine and the app need to be on the same version of Rails?
[13:21:08] openstruct: *implementing a Rails engine to be mounted on another Rails app,
[13:22:09] jhass: well, compatible to is the better phrasing
[13:22:21] jhass: you can write an engine in such a way that it's compatible to more than one version
[13:22:59] openstruct: That makes sense - best bet would be to hit the changelogs and look for breaking changes?
[13:23:18] openstruct: Or I bet I could add various dummy apps in the engine specs with different Rails versions.
[13:25:24] dunpeal: matthewd: thanks
[13:25:53] wd40s: has joined #RubyOnRails
[13:26:11] dunpeal: I have a model Foo that has_many :bars. How do I get all instances of a Bar to which no Foo is associated?
[13:26:47] tycoon177: Bar would also blongs_to :foo
[13:27:07] l4v2: has joined #RubyOnRails
[13:27:30] dunpeal: tycoon177: in this case, it actually doesn't...
[13:27:35] tycoon177: Then you could do something like Bar.where('foo.id is null'
[13:27:42] tycoon177: Uh, why not?
[13:28:19] dunpeal: tycoon177: not sure. in every case where Foo has_many :bars, does Bar have to belong_to :foo explicitly?
[13:28:30] banisterfiend: has joined #RubyOnRails
[13:28:41] tycoon177: no, but you won't have the id in Bar
[13:28:45] tildes: has joined #RubyOnRails
[13:29:02] tycoon177: so checking if bar belongs to anything would require checking of every foo
[13:29:13] dunpeal: ah, makes sense
[13:29:26] dunpeal: isn't that information duplication though?
[13:29:43] tycoon177: has_many doesnt have the id in the table...
[13:29:47] dunpeal: i.e. every association between a Foo and a Bar would be written twice
[13:29:54] tycoon177: does Bar have a foo_id?
[13:30:36] dunpeal: tycoon177: oh, it does. just not the belongs_to line. should I add it?
[13:30:49] tycoon177: i mean, there's nothing wrong with it
[13:30:58] dunpeal: tycoon177: OK, I was wrong, the belongs_to is there
[13:31:11] tycoon177: Then you could do something like Bar.where('foo.id is null')
[13:31:34] hanwei_: has joined #RubyOnRails
[13:31:49] marr: has joined #RubyOnRails
[13:32:09] hanwei_: has joined #RubyOnRails
[13:32:14] dunpeal: tycoon177: shouldn't it be Bar.where('foo_id is null')?
[13:32:20] dunpeal: foo_id, not foo.id?
[13:32:45] hanwei_: has joined #RubyOnRails
[13:32:49] tycoon177: i just got to work and im off in like 3 hours so i'm not really thinking much toda
[13:32:54] jhass: .where(foo_id: nil)
[13:33:00] dunpeal: np, thanks :)
[13:33:18] jhass: perhaps .where(foo: nil) even, never checked
[13:33:27] hanwei_: has joined #RubyOnRails
[13:33:44] tycoon177: does that work jhass? I was worried that it would do (foo_id = null) in the query and thus always return the record
[13:33:52] dunpeal: jhass: yeah, that works.
[13:34:09] hanwei_: has joined #RubyOnRails
[13:34:27] jhass: tycoon177: rails' smart enough to know that is should be IS NULL ;)
[13:34:51] jhass: eh, that nil should be
[13:35:21] beilabs_: has joined #RubyOnRails
[13:36:07] hanwei_: has joined #RubyOnRails
[13:36:51] Rodya_: has joined #RubyOnRails
[13:38:30] defswork: has joined #RubyOnRails
[13:41:09] fmcgeough: has joined #RubyOnRails
[13:41:12] dunpeal: How do I do an IS NOT NULL?
[13:41:28] dunpeal: i.e. all Bars where .foo is not null.
[13:42:10] doodlehaus: has joined #RubyOnRails
[13:42:20] tercenya: has joined #RubyOnRails
[13:43:41] roamingdog: has joined #RubyOnRails
[13:48:21] Rodya_: has joined #RubyOnRails
[13:49:55] dunpeal: nvm, found it: Bar.where.not(foo: nil)
[13:51:54] Rodya_: has joined #RubyOnRails
[13:56:11] Ergo^: has joined #RubyOnRails
[14:03:58] dminuoso: has joined #RubyOnRails
[14:04:29] dat1guy: has joined #RubyOnRails
[14:04:48] pawnbox: has joined #RubyOnRails
[14:04:52] dunpeal: What does the reload! method do?
[14:05:19] dunpeal: In rails console
[14:06:52] Papierkorb: dunpeal: reloads your application source code, if you changed it but don't want to restart the whole console session
[14:07:08] dat1guy: Is there a way to have an optional argument in a route where when passing an object to its path helper it'll take the attribute on the model to generate the route?
[14:07:15] fewfewf: has joined #RubyOnRails
[14:07:21] fewfewf: Hello, my rails 4.2.x latest does not respect the custom "validates format" message, any ideas? validates :macaddress, format: { with: /\A[a-f0-9]{12}\z/, message: 'only allows 12 integers and lowercase letters, eg: 000a959d6816' }, presence: true, uniqueness: true
[14:07:21] fewfewf: The error message defaults to "Is invalid"
[14:07:46] dunpeal: Papierkorb: that's really useful, considering how long it takes to load Rails and all its dependencies. Is there a way to reload just a particular class or set of files?
[14:07:57] akshat: has joined #RubyOnRails
[14:08:04] tildes: has joined #RubyOnRails
[14:08:41] Papierkorb: dunpeal: Nope. reload! works exactly like the automatic code reloader for the webpage. Due to various reasons, it's a "all or nothing"
[14:08:50] matthewd: dunpeal: No. (But it's technically not reloading anyway.. it's only unloading, then they'll get loaded again on demand)
[14:08:55] ElFerna: has joined #RubyOnRails
[14:08:57] xall_: has joined #RubyOnRails
[14:08:58] dvinciguerra_: has joined #RubyOnRails
[14:09:16] Papierkorb: dunpeal: Oh, it does not reload gems. So if you do bundle install or update, you'll have to restart the console session
[14:09:35] jenrzzz: has joined #RubyOnRails
[14:10:03] mark_66: has joined #RubyOnRails
[14:10:11] jhass: dat1guy: I don't think so
[14:11:44] dat1guy: jhass: so yesterday I tried overriding to_param, but the thing is this route has more than one param so I can't use it.
[14:11:57] dat1guy: then I tried just overrising the path helper
[14:12:31] dat1guy: and it works but I can't seem to find an easy way to do it without breaking all the other functionalities of the path helper since it takes (*args) as an argument
[14:12:31] matthewd: dat1guy: https://github.com/rails/rails/issues/22512 is relevant.. but obviously doesn't help you today
[14:13:00] matthewd: dat1guy: !gist what you've got?
[14:13:00] helpa: dat1guy: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:13:07] moeabdol: has joined #RubyOnRails
[14:14:21] moeabdol1: has joined #RubyOnRails
[14:15:00] dunpeal: Papierkorb, matthewd: good enough, thanks!
[14:16:02] dat1guy: matthewd, jhass: https://gist.github.com/fbernier/7f45a81617dc94a4b6d85161db5484c5
[14:16:47] dat1guy: the problem with this solution is using pen_name_path(id: 1) doesn't work anymore. I always have to pass an object to it.
[14:17:15] mdw: has joined #RubyOnRails
[14:17:18] matthewd: So change the method signature
[14:18:06] jhass: I wonder what happens when you return an array from to_param
[14:18:12] dat1guy: matthewd: yeah I guess but the original method signature takes *args I think and is quite complex ..
[14:19:06] dat1guy: jhass: it does .to_s on the array ..
[14:19:19] mauro1254: has joined #RubyOnRails
[14:19:22] jhass: : why override instead of adding say pen_name_slug_path ?
[14:20:18] matthewd: Overriding means it'll work with polymorphic_path too
[14:20:31] dat1guy: didn't feel like replacing all the existing calls and having others know they have to use this now. Just wanted it more seamless but yeah I guess that's what I'll end up with.
[14:20:55] matthewd: I really don't understand what's complex about adding a conditional to the method
[14:21:06] TheMoonMaster: has joined #RubyOnRails
[14:21:31] matthewd: Surely the bigger question is what you want it to do when given an ID, from which it's not so easy to derive a slug
[14:21:38] Rodya_: has joined #RubyOnRails
[14:21:47] mauro1254: I guys in a collection of apps with single sign on, having one app dedicated to authentication, which is the best approach for authorization?
[14:21:56] dat1guy: matthewd: I might be wrong about the complexity but I feel like I would have to replicate all of this: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/route_set.rb#L283
[14:22:05] abhinavmehta: I've created a new directory inside my app/ (lets name it as extensions) .. and added that to config.autoload_paths+= %W"
[14:22:20] abhinavmehta: ^ ignore above (its partial, let me post it full)
[14:22:40] abhinavmehta: I've created a new directory inside my app/ (lets name it as extensions) .. and added that to config.autoload_paths+= %W"#{config.root}/app/extensions" in application.rv
[14:22:40] dat1guy: matthewd: if you're just given and id, I simply want the route without the slug.
[14:22:55] mauro1254: Users are managed in the AUTH app, therefore I should assign abilities to them in that APP. I could then define a WS to ask for permissions.
[14:23:08] abhinavmehta: now in my rails console, I can access modules/classes containing in extensions folder
[14:23:10] mauro1254: What do you think? Are there other approaches?
[14:23:42] Papierkorb: mauro1254: I do something like this
[14:23:49] Oliphaunte: has joined #RubyOnRails
[14:23:51] tercenya: has joined #RubyOnRails
[14:23:58] abhinavmehta: but my models/controllers cant access(load) it.
[14:24:15] universa1: abhinavmehta: code + error
[14:24:22] Papierkorb: mauro1254: http://nginx.org/en/docs/http/ngx_http_auth_request_module.html my frontend NGINX first sends every request to my auth app, which does HTTP Basic Auth (So no fancy login stuff this way)
[14:24:24] mauro1254: Papierkorb: is your authorization system built from scratch?
[14:24:26] lunaelli: has joined #RubyOnRails
[14:24:34] waseem_: abhinavmehta: Try restarting your server.
[14:24:43] armyriad: has joined #RubyOnRails
[14:24:49] abhinavmehta: waseem_: I restarted multiple times now.
[14:24:53] Papierkorb: mauro1254: May be good enough for company-internal things, lesser so for public facing webpages I guess
[14:25:07] Oliphaunte: has joined #RubyOnRails
[14:25:07] waseem_: abhinavmehta: They show your code and error in a gist.
[14:25:21] abhinavmehta: there is some concept of eager loading, which came with Rails 4 - I'm guessing that has to do something with it.
[14:25:59] Papierkorb: mauro1254: The auth app is built by me, yes. It manages different users, apps, and their access to those. On the authorization front, it only knows about "read" and "write" access, nothing else. Good enough for small single purpose apps.
[14:26:37] hwcomcn: has joined #RubyOnRails
[14:26:40] mauro1254: Papierkorb: I have a doze of apps and I need to define roles / abilities for each app
[14:26:52] matthewd: dat1guy: def x(*args); if args.first.is_a?(M); args << {} unless args.last.is_a?(Hash); args.last[:slug] ||= args.first.slug; end; super; end
[14:26:57] Papierkorb: mauro1254: Bigger applications have pretty complex permission systems, which would require the auth app to know exactly about it.
[14:27:12] hwcomcn: has joined #RubyOnRails
[14:27:18] universa1: abhinavmehta: put your code along with the full error trace in a gist and we might be able to help you.
[14:27:28] jhass: abhinavmehta: spring? spork? space in config.root?
[14:27:47] mauro1254: Papierkorb: are there gems dedicated to that?
[14:27:47] hwcomcn: has joined #RubyOnRails
[14:27:57] dat1guy: matthewd: thanks, taking a look.
[14:27:59] Papierkorb: mauro1254: You can do it this way. It works good enough as long you don't need row-level ACLs. Stuff like "can edit every Recipe" works fine this way, but not "can edit this and this Recipe, but not the other one". For the latter, you'll want to do authorization in the target app, and authentication in the auth app
[14:28:47] hwcomcn: has joined #RubyOnRails
[14:28:48] Papierkorb: mauro1254: Not sure, my auth app isn't a Rails app.
[14:29:00] mauro1254: Papierkorb: if I do authorization in target app, then how can I associate permissions to users? Users are defined in auth app.
[14:29:13] prithaj: has joined #RubyOnRails
[14:29:40] Papierkorb: mauro1254: Right, but the auth app can pass-through custom headers to the target app. I use it to pass through the user id and the permissions the user has in the app globally.
[14:30:09] Papierkorb: mauro1254: Are you fine with having a HTTP Basic auth dialog shown to the user, or do you need a "proper" login page?
[14:30:24] Rodya__: has joined #RubyOnRails
[14:30:25] mauro1254: well, currently I'm redirecting to auth app
[14:30:45] mauro1254: the user log in and then will be redirected back to the target app
[14:30:55] mauro1254: session cookie is shared
[14:32:11] Papierkorb: mauro1254: Ah. You can do that too, but not with the auth_request stuff of NGINX. I'd have a middleware in the target app(s) checking for the cookie, parsing it and/or redirecting the user.
[14:32:45] dunpeal: I have a class that is part of the Rails echo system, and (in particular) uses multiple existing Models, but is not itself a Model. Where should I put its source file within the Rails directory structure?
[14:32:55] hwcomcn: has joined #RubyOnRails
[14:33:31] jhass: I tend to stuff them into lib
[14:33:40] hwcomcn: has joined #RubyOnRails
[14:33:51] dunpeal: jhass: will it be automatically loaded, and reloaded when I call reload!?
[14:33:56] mauro1254: The authentication is not a problem, it is working.
[14:34:10] jhass: if there are many similar ones a new folder in app can make sense too
[14:34:12] dat1guy: matthewd: yeah I think that covers most of the functionalities. Thanks!
[14:34:16] yoongkang: has joined #RubyOnRails
[14:34:21] jhass: dunpeal: only if you add lib to config.autoload_paths
[14:35:11] pawnbox: has joined #RubyOnRails
[14:35:34] dunpeal: jhass: there aren't going to be many of these. maybe I should just put it in app/models?
[14:35:40] hwcomcn: has joined #RubyOnRails
[14:35:45] matthewd: dunpeal: app/services/ is popular
[14:35:58] matthewd: Depends what it is
[14:39:13] mauro1254: Papierkorb: found this: http://codetheory.in/rails-devise-omniauth-sso/
[14:40:37] dunpeal: matthewd: probably makes sense. it's basically a class that performs high-level data-integrity checks on a few models. checks some complex relations between them, renders statistics about these, and sometimes mutates some model instances.
[14:41:25] pawnbox_: has joined #RubyOnRails
[14:41:56] The_Phoenix: has joined #RubyOnRails
[14:46:18] zacts: has joined #RubyOnRails
[14:46:23] let_jesus_take_t: has joined #RubyOnRails
[14:46:32] oystersauce8: has joined #RubyOnRails
[14:47:07] Macaveli: has joined #RubyOnRails
[14:47:14] p1k: the point isn't where you put your files, it's that your project structure is consistent and other people working on it understand it
[14:48:35] tercenya: has joined #RubyOnRails
[14:48:52] polishdub: has joined #RubyOnRails
[14:50:56] let_jesus_take_t: Hello. I'm trying to use omniauth-facebook for OAuth. To get the 'email', facebook requires you to use the popup method, but that isn't happening, resulting in me not getting the data I need. Here is my initialization file: https://gist.github.com/anonymous/330e265e82888801e3c2beb78f1e158f
[14:51:48] let_jesus_take_t: TL:DR: Popup isn't popping up
[14:51:55] fernandomm: has joined #RubyOnRails
[14:52:49] Ropeney: has joined #RubyOnRails
[14:55:49] jtong: has joined #RubyOnRails
[14:57:03] tildes: has joined #RubyOnRails
[14:57:29] daveomcd_: has joined #RubyOnRails
[14:58:55] oryman: has joined #RubyOnRails
[15:00:24] adavia: has joined #RubyOnRails
[15:00:36] let_jesus_take_t: Oh I got it working. I didn't realize you had to have both the omniauth-facebook and omniauth gem. Unfortunately I only had the former
[15:00:58] johnkpaul: How can I run all of the migrations instead of using db/schema.rb to re-setup my database?
[15:01:04] MaDErroR123: has joined #RubyOnRails
[15:01:20] johnkpaul: I have a migration that sets the auto_increment value, but that’s not running when I set everything up on a staging environment
[15:01:32] johnkpaul: because the migration uses execute “set auto increment..."
[15:01:36] johnkpaul: but that doesn’t modify schema.rb
[15:01:45] johnkpaul: I’m running into the same problem as http://stackoverflow.com/questions/29994805/activerecord-altering-a-table-to-set-an-auto-increment-minimum-value
[15:02:02] johnkpaul: should I be setting up the auto increment start valuein db/seed instead of in a migration?
[15:02:55] arup_r1: has joined #RubyOnRails
[15:03:18] roamingdog: has joined #RubyOnRails
[15:03:25] xall_: has joined #RubyOnRails
[15:04:07] let_jesus_take_t: Weird, there still isn't a popup, it's just fetching the email now
[15:05:48] adavia: I am a little confused. How can i subscribe to a channel using actioncable after an ajax request
[15:07:21] boomer: has joined #RubyOnRails
[15:07:34] dionysus69: has joined #RubyOnRails
[15:07:54] tubbo: adavia: check out the second example here https://github.com/rails/rails/tree/master/actioncable#channel-example-1-user-appearances
[15:08:47] adavia: thanks tubbo
[15:10:39] zacts|pi: has joined #RubyOnRails
[15:10:48] jenrzzz: has joined #RubyOnRails
[15:11:54] douglascorrea: has joined #RubyOnRails
[15:13:48] jhass: dunpeal: sounds like that class does way too much :P
[15:13:57] one_zero: has joined #RubyOnRails
[15:15:55] abhinavmehta: has joined #RubyOnRails
[15:21:05] Rodya_: has joined #RubyOnRails
[15:24:11] beilabs: has joined #RubyOnRails
[15:25:21] conta1: has joined #RubyOnRails
[15:26:45] andatche: has joined #RubyOnRails
[15:27:57] queequeg1: has joined #RubyOnRails
[15:29:13] benlieb: has joined #RubyOnRails
[15:29:55] djgraham|calypso: has joined #RubyOnRails
[15:30:36] bob_f: has joined #RubyOnRails
[15:30:41] funnel_: has joined #RubyOnRails
[15:30:48] marahin: has joined #RubyOnRails
[15:31:00] reaVer_: has joined #RubyOnRails
[15:31:11] Phoop: has joined #RubyOnRails
[15:31:13] danman: has joined #RubyOnRails
[15:31:40] dagelf_: has joined #RubyOnRails
[15:31:56] swav: has joined #RubyOnRails
[15:32:14] douglascorrea: has joined #RubyOnRails
[15:32:28] disgrntld: has joined #RubyOnRails
[15:33:00] Macaveli: has joined #RubyOnRails
[15:33:36] Terens1: has joined #RubyOnRails
[15:34:55] Ropeney: has joined #RubyOnRails
[15:35:41] Mchl: has joined #RubyOnRails
[15:35:45] yoongkang: has joined #RubyOnRails
[15:37:24] douglasc_: has joined #RubyOnRails
[15:38:04] janno_: has joined #RubyOnRails
[15:38:05] DarkBushido_: has joined #RubyOnRails
[15:39:04] RTG`: has joined #RubyOnRails
[15:39:26] apeiros_: has joined #RubyOnRails
[15:39:32] hayden__: has joined #RubyOnRails
[15:39:49] DarkBushido: has joined #RubyOnRails
[15:40:03] zacts_raincity: has joined #RubyOnRails
[15:41:20] dvinciguerra_: has joined #RubyOnRails
[15:42:06] dustinm`: has joined #RubyOnRails
[15:43:08] alfiemax: has joined #RubyOnRails
[15:43:35] siaw23: has left #RubyOnRails: ()
[15:47:08] shaman42: has joined #RubyOnRails
[15:47:08] jjwright: has joined #RubyOnRails
[15:47:08] mosez: has joined #RubyOnRails
[15:47:08] Gizmokid2005: has joined #RubyOnRails
[15:47:09] eyck: has joined #RubyOnRails
[15:47:09] noah256: has joined #RubyOnRails
[15:47:16] Jorgon: has joined #RubyOnRails
[15:47:16] tanuki: has joined #RubyOnRails
[15:47:16] Fire-Dragon-DoL: has joined #RubyOnRails
[15:47:16] EXCHGR: has joined #RubyOnRails
[15:47:22] FernandoBasso: has joined #RubyOnRails
[15:47:23] atrius: has joined #RubyOnRails
[15:47:30] polishdub: has joined #RubyOnRails
[15:47:36] wmoxam: has joined #RubyOnRails
[15:47:38] Oliphaunte: has joined #RubyOnRails
[15:47:39] tercenya: has joined #RubyOnRails
[15:47:46] coffeejunk: has joined #RubyOnRails
[15:47:46] cydrobolt: has joined #RubyOnRails
[15:47:46] cydrobolt: has joined #RubyOnRails
[15:47:54] llakey: has joined #RubyOnRails
[15:47:56] Ergo^: has joined #RubyOnRails
[15:48:13] doubleemms: has joined #RubyOnRails
[15:48:45] Cork: has joined #RubyOnRails
[15:49:44] zacts: has joined #RubyOnRails
[15:49:54] [Butch]: has joined #RubyOnRails
[15:49:59] dragon9783: has joined #RubyOnRails
[15:50:44] srinidhi: has joined #RubyOnRails
[15:52:10] HalcyonicStorm: has joined #RubyOnRails
[15:53:02] pawnbox: has joined #RubyOnRails
[15:54:04] jtd: has joined #RubyOnRails
[15:54:59] asianMike: has joined #RubyOnRails
[15:56:15] pwnd_nsfw: has joined #RubyOnRails
[15:57:39] xall_: has joined #RubyOnRails
[15:58:24] bga57: has joined #RubyOnRails
[15:59:27] universa1: has joined #RubyOnRails
[16:03:12] macsteps: has joined #RubyOnRails
[16:03:19] isberg: has joined #RubyOnRails
[16:07:08] pur3eval: has joined #RubyOnRails
[16:07:58] eGGshke: has joined #RubyOnRails
[16:13:56] abhinavmehta: has joined #RubyOnRails
[16:14:30] darutoko-: has joined #RubyOnRails
[16:15:57] douglascorrea: has joined #RubyOnRails
[16:17:18] pLaTo0n: has joined #RubyOnRails
[16:18:03] roamingdog: has joined #RubyOnRails
[16:22:07] Rodya_: has joined #RubyOnRails
[16:23:34] pawnbox: has joined #RubyOnRails
[16:25:41] Cohedrin: has joined #RubyOnRails
[16:28:23] l4v2: has joined #RubyOnRails
[16:31:38] andywww_: has joined #RubyOnRails
[16:32:10] darutoko: has joined #RubyOnRails
[16:37:36] ur5us: has joined #RubyOnRails
[16:40:36] chandlerbing: has joined #RubyOnRails
[16:41:17] tildes: has joined #RubyOnRails
[16:44:36] GodFather: has joined #RubyOnRails
[16:45:08] manfrin: has joined #RubyOnRails
[16:46:40] GodFather: has joined #RubyOnRails
[16:47:12] nacsurte: has joined #RubyOnRails
[16:47:32] nacsurte: anyone used ransack before? i want to make it so that all queries have an added 'where' clause
[16:47:37] nacsurte: can't figure it out
[16:50:27] brendan-: has joined #RubyOnRails
[16:50:50] abhinavmehta: has joined #RubyOnRails
[16:51:27] GodFather: has joined #RubyOnRails
[16:53:37] DoctorMonocular: has joined #RubyOnRails
[16:54:11] banisterfiend: has joined #RubyOnRails
[16:56:25] openstruct: has joined #RubyOnRails
[16:58:04] djbkd: has joined #RubyOnRails
[17:00:21] drim: has joined #RubyOnRails
[17:00:40] agent_white: has joined #RubyOnRails
[17:02:57] Mirubiri: has joined #RubyOnRails
[17:05:21] Switchblade: has joined #RubyOnRails
[17:07:53] amiuhle: has joined #RubyOnRails
[17:08:15] macsteps_: has joined #RubyOnRails
[17:08:35] n90b0jjf: has joined #RubyOnRails
[17:09:08] pawnbox: has joined #RubyOnRails
[17:09:34] n90b0jjf: how can I print an object's created_at/updated_at with the seconds? when I do `p User.last.created_at` I get: 07/22/2016 17:00
[17:09:55] n90b0jjf: in the console though I get something like: Mon, 18 Jul 2016 20:01:06 UTC +00:00
[17:10:00] n90b0jjf: how can I print that format
[17:10:15] n90b0jjf: ideally through using `puts`
[17:11:25] siaW: has joined #RubyOnRails
[17:11:50] Axsuul: has joined #RubyOnRails
[17:14:39] drim: what's the best way to dynamically add a locale file at run time?
[17:16:14] siaW: i’m got back to my R4IA book but have problems with this failure: https://gist.github.com/siaw23/410741293602565421ae8df6a91826f2#file-console-txt
[17:16:38] siaW: it’s complanining it can’t find field "File #2" and i’m not sure why. any ideas?
[17:22:24] openstruct: has joined #RubyOnRails
[17:24:01] Rodya_: has joined #RubyOnRails
[17:24:52] daveomcd_: has joined #RubyOnRails
[17:26:19] Mirubiri: siaw: could you upload the attachments/form partial?
[17:27:14] shinnya: has joined #RubyOnRails
[17:27:26] siaW: Mirubiri: https://gist.github.com/siaw23/410741293602565421ae8df6a91826f2#file-_attachment_form-html-erb
[17:27:28] Mirubiri: maybe the fields are "File #0" and "File #1" and that's why capy can't find the field
[17:27:48] vjacob: has joined #RubyOnRails
[17:28:29] arup_r: has joined #RubyOnRails
[17:29:10] Mirubiri: siaw: you are only generating a field named "File #1"...
[17:30:01] Mirubiri: you need a loop to generate more than 1 field in that partial
[17:31:02] dionysus69: has joined #RubyOnRails
[17:31:26] openstruct: I'm a bit confused on how to work with models in a rails engine and their associations when a mounting app might have similar models. Basic example - https://gist.github.com/anonymous/3ec27b50fd624c2d71df8359fc5731d1
[17:32:06] ramortegui: has joined #RubyOnRails
[17:33:00] Mirubiri: siaw: oh I'm a little bit asleep xD
[17:33:53] efy: has joined #RubyOnRails
[17:34:17] djbkd: has joined #RubyOnRails
[17:35:00] djbkd: has joined #RubyOnRails
[17:35:01] openstruct: I'm under the impression that the models within a rails engine need to have the class_name specified to keep the relations strict.
[17:35:43] djbkd: has joined #RubyOnRails
[17:35:54] roamingdog: has joined #RubyOnRails
[17:36:26] efy: does anyone have any advice on fragment caching by count of records? e.g. i have a view that aggregates a bunch of data and when a new record is added it should invalidate the cache
[17:38:27] yoongkang: has joined #RubyOnRails
[17:38:27] Mirubiri: siaw: where are you updating ticket.attatchment.size after you attach the firs file?
[17:38:46] arup_r: openstruct: You use engine models with the namesapce like MyEngine::Model right?
[17:39:09] openstruct: arup_r: Yeah
[17:39:09] djbkd: has joined #RubyOnRails
[17:39:10] arup_r: so, evenif the the main app has the same name models, there will not be any conflict
[17:39:32] arup_r: but, it is very rare to have the main app and engines same models. :)
[17:39:38] Mirubiri: index is always 1
[17:40:00] boomer: has joined #RubyOnRails
[17:40:13] openstruct: I was just surprised that I could assign a normal User to the MyEngine::Article. I figured it'd only accept MyEngine::User
[17:40:14] arup_r: so openstruct don't need to to be worried :p go ahead and have fun!
[17:41:07] arup_r: openstruct: yeah, true.
[17:41:39] openstruct: arup_r: I'm tempting to specify class_name for all my engine models just to prevent others from attempting to do something similar.
[17:41:53] xlegoman: has joined #RubyOnRails
[17:41:57] arup_r: another thing is, your engine tables names are like my_engine_users and main app is users .. so table names are also different as per the conventions
[17:42:16] siaW: Mirubiri: yes and i’m not sure why
[17:42:29] siaW: in the tutorial it seems to work for them i believe
[17:42:39] openstruct: True but the foreign_keys don't include the engine prefix...at least not in the railsguide
[17:42:41] asianMike: has joined #RubyOnRails
[17:43:22] openstruct: MyEngine::Article (my_engine_article) would have user_id instead of (my_engine_user)...which also surprised me :)
[17:43:26] jheathco: has joined #RubyOnRails
[17:44:19] arup_r: I got that. But I do think devs will read the doc and usage .. so preventing their mistake might be lot of codes.
[17:44:40] openstruct: True. Thanks for helping me check my sanity.
[17:45:10] Circuit8: has joined #RubyOnRails
[17:46:23] xall_: has joined #RubyOnRails
[17:47:57] Circuit8: Hey guys, If I have model Teacher which has_many :pupils, and Pupil belongs_to :teacher. then when i do Teacher.new.pupils.build.save! I get an error `ActiveRecord::RecordInvalid: Validation failed: Pupils teacher must exist`
[17:48:22] Circuit8: How can I save a parent model that has children associated with it?
[17:48:33] Mirubiri: siaw: the first attachtment is uploaded instantly when you drop a file?
[17:48:55] siaW: no. it’s not uploaded until i submit the form
[17:48:57] Circuit8: I'm guessing its to do with the Pupil model not having the Teacher id set when it comes to save as the Teacher doesn't exist yet
[17:49:02] Circuit8: But not sure, any ideas?
[17:49:10] adre: has joined #RubyOnRails
[17:49:13] Mirubiri: siaw: Then the size of attachtments ins never updated
[17:49:15] nettoweb: has joined #RubyOnRails
[17:49:16] Mirubiri: it can't work
[17:50:18] siaW: but should it be uploaded instantly?? what if the user has more files to attach? and if you mean instant, then how can the app know which ticket the attachment is for?
[17:50:42] nettoweb: huys guys, Im creating the new version of a website using rails but all my data is in a mysql db, ewhats the best way to import to a postgres? I thought in doing with a ruby script but you know if the mysql/postgres provide an easy way to do this?
[17:51:05] Mirubiri: siaw: wich tutorial are you following?
[17:51:09] tubbo: nettoweb: can you export the mysql tables to CSV?
[17:51:12] siaW: rails 4 in action
[17:51:26] Mirubiri: I think I have that book here
[17:51:31] nettoweb: tubbo yes, and then import with a ruby script?
[17:51:40] aegis3121: has joined #RubyOnRails
[17:51:51] tercenya: has joined #RubyOnRails
[17:51:54] tubbo: nettoweb: you don't necessarily even need to do that (though it might be useful to use ActiveRecord::Base.connection to talk to the DB) https://www.postgresql.org/docs/current/static/sql-copy.html
[17:51:57] Mirubiri: siaw: page?
[17:52:07] tubbo: especially with massive datasets, COPY FROM CSV is really fast
[17:52:29] siaW: oh. now i’m ont page 386 (11.1.2)
[17:52:36] siaW: i left that error to move on with the rest
[17:52:43] siaW: but i can find that section for you in a bit
[17:52:54] aegis3121: has joined #RubyOnRails
[17:53:20] pawnbox: has joined #RubyOnRails
[17:53:31] siaW: Mirubiri: page 316 (9.4.4)
[17:54:09] siaW: Mirubiri: my repo is here: https://github.com/siaw23/ticket_tracker
[17:55:51] oystersauce8: has joined #RubyOnRails
[17:56:32] Mirubiri: siaw: you have skipped this line in your partial, who tracks the index var
[17:56:33] Mirubiri: <% index = 0 %>
[17:57:26] Mirubiri: and the surrounding code
[17:58:49] Mirubiri: not possible
[17:59:59] siaW: Mirubiri: that’s not it
[18:00:11] siaW: unfortunately :(
[18:01:10] Diabolik: has joined #RubyOnRails
[18:01:41] Diabolik: has joined #RubyOnRails
[18:01:56] Mirubiri: siaw: page 323
[18:02:03] Mirubiri: maybe you don0t have the coffescript right
[18:02:12] GnuYawk: has joined #RubyOnRails
[18:02:58] Mirubiri: where index is updated given the leng of the file divs
[18:03:14] alfiemax: has joined #RubyOnRails
[18:03:22] Mirubiri: the bug has to be there
[18:03:34] tercenya: has joined #RubyOnRails
[18:04:10] pawnbox: has joined #RubyOnRails
[18:04:16] tubbo: hey siaw, you might have an issue with this https://github.com/siaw23/ticket_tracker/blob/master/app/assets/javascripts/responsive.scss
[18:05:07] siaW: Mirubiri: that’s not it :(
[18:05:17] siaW: tubbo: i’m checking
[18:05:34] tubbo: siaw: what i mean is the file is in the wrong dir
[18:06:36] macsteps: has joined #RubyOnRails
[18:06:42] tubbo: siaw: so where exactly does that happen?
[18:07:10] siaW: tubbo: when i’m testing for the creating of a new ticket
[18:08:15] tubbo: siaw: no i mean when you click '#add_file'
[18:08:21] tubbo: but i found it in https://github.com/siaw23/ticket_tracker/blob/master/app/assets/javascripts/tickets.coffee#L8
[18:08:46] siaW: right!!!
[18:08:49] tubbo: siaw: so can you throw a `debugger` statement in there, open your JS console, and verify that the function bound to that click event is actually getting called?
[18:08:51] siaW: it’s in the wrong folder
[18:09:01] moeabdol1: has joined #RubyOnRails
[18:09:11] pawnbox: has joined #RubyOnRails
[18:11:22] douglascorrea: has joined #RubyOnRails
[18:12:19] douglascorrea: has joined #RubyOnRails
[18:12:47] Pazician: has joined #RubyOnRails
[18:12:53] jenrzzz: has joined #RubyOnRails
[18:12:53] jenrzzz: has joined #RubyOnRails
[18:13:05] leops: has joined #RubyOnRails
[18:13:06] siaW: i put it in the right folder. same error though.
[18:15:03] arup_r: tubbo: it was long I didn't see you. how are you? :)
[18:16:01] tercenya: has joined #RubyOnRails
[18:16:03] sumobob: has joined #RubyOnRails
[18:16:08] n90b0jjf: has joined #RubyOnRails
[18:22:44] pur3eval: has joined #RubyOnRails
[18:26:29] Markhor1991: has joined #RubyOnRails
[18:26:44] Paradox: has joined #RubyOnRails
[18:26:50] pawnbox: has joined #RubyOnRails
[18:27:22] jstransky: has joined #RubyOnRails
[18:28:48] qejk: has joined #RubyOnRails
[18:29:00] chouhoulis: has joined #RubyOnRails
[18:30:45] AndrewIsHere: has joined #RubyOnRails
[18:35:11] MaDErroR123: has joined #RubyOnRails
[18:36:26] pickandmix: has joined #RubyOnRails
[18:36:28] mwlang: has joined #RubyOnRails
[18:37:27] marr: has joined #RubyOnRails
[18:39:37] yoongkang: has joined #RubyOnRails
[18:39:39] oystersauce8: has joined #RubyOnRails
[18:45:28] Rodya_: has joined #RubyOnRails
[18:48:18] Dimik: has joined #RubyOnRails
[18:49:54] diegoviola: has joined #RubyOnRails
[18:50:31] pur3eval_: has joined #RubyOnRails
[18:50:51] travismathis: has joined #RubyOnRails
[18:51:51] rodferso1: has joined #RubyOnRails
[18:52:53] leops: has joined #RubyOnRails
[18:53:12] beilabs: has joined #RubyOnRails
[18:57:46] theery: has joined #RubyOnRails
[19:00:39] pur3eval: has joined #RubyOnRails
[19:04:48] Axilla: has joined #RubyOnRails
[19:10:09] xall_: has joined #RubyOnRails
[19:14:15] jenrzzz: has joined #RubyOnRails
[19:18:46] Oliphaunte: has joined #RubyOnRails
[19:19:09] rvanlieshout: has joined #RubyOnRails
[19:24:11] roshanavnad_: has joined #RubyOnRails
[19:26:21] GodFather: has joined #RubyOnRails
[19:28:59] petor: has joined #RubyOnRails
[19:29:30] pawnbox: has joined #RubyOnRails
[19:33:31] moeabdol1: has joined #RubyOnRails
[19:35:52] GnuYawk: has joined #RubyOnRails
[19:37:01] weaksauce: has joined #RubyOnRails
[19:39:01] pawnbox: has joined #RubyOnRails
[19:39:26] robin____: has joined #RubyOnRails
[19:40:37] yoongkang: has joined #RubyOnRails
[19:43:01] noobda: has joined #RubyOnRails
[19:43:05] noobda: Hey guys. Anyone working on a rails opensource project need an extra programmer?
[19:45:55] hahuang61: has joined #RubyOnRails
[19:53:10] DoctorMonocular: has joined #RubyOnRails
[19:53:24] arup_r: has joined #RubyOnRails
[19:57:04] clandry94: Hi, I have a custom class under my app folder that I would like to access the current users cookies at. Currently, I get an undefined method cookies error. Is there something I need to include in my class in order to access them?
[20:00:22] arup_r: clandry94: you have to pass them as an argument to your own class
[20:03:12] macsteps: has joined #RubyOnRails
[20:04:17] beilabs: has joined #RubyOnRails
[20:07:47] banisterfiend: has joined #RubyOnRails
[20:08:12] srinidhi: has joined #RubyOnRails
[20:11:54] jenrzzz: has joined #RubyOnRails
[20:18:21] Oliphaunte: has joined #RubyOnRails
[20:22:26] alfiemax: has joined #RubyOnRails
[20:23:46] quazimodo: has joined #RubyOnRails
[20:23:46] quazimod1: has joined #RubyOnRails
[20:24:19] noobda: Guys, anyone working on a rails opensource project need an extra programmer? I would be happy to help.
[20:25:04] tubbo: noobda: my advice would be to find a few projects out there that are fun or you use, and make pull requests to them
[20:25:36] noobda: tubbo: How do I find fun projects? :P
[20:25:58] tubbo: noobda: i'm not sure what you find fun, so not sure how to answer
[20:26:24] noobda: tubbo: True that. Well, how do you find fun projects?
[20:26:27] hahuang61: has joined #RubyOnRails
[20:27:14] tubbo: noobda: i'm a musician so i tend to gravitate towards musically inclined projects. also projects that i work with every day, like mongoid or redis-rails
[20:27:29] tubbo: i'm a contributor on redis-rails and redis-store...we'd love to have your contributions :)
[20:27:44] matthewd: noobda: Things you use is the best bet
[20:28:05] noobda: tubbo: Will check their github! Thanks
[20:28:31] noobda: matthewd: Okey
[20:31:56] funrep: has joined #RubyOnRails
[20:32:52] fox_mulder_cp: tubbo: good evening
[20:33:13] hck89: has joined #RubyOnRails
[20:33:36] fox_mulder_cp: some can help me with gem, such as public_activity, but with corrent uuids support?
[20:34:37] hck89: has joined #RubyOnRails
[20:34:48] wasane: has joined #RubyOnRails
[20:35:03] Brando753-o_O_o: has joined #RubyOnRails
[20:37:49] roamingdog: has joined #RubyOnRails
[20:38:13] dunpeal: What's the best way to have an arbitrary Ruby file run immediately after Rails console launches?
[20:39:31] axl_: has joined #RubyOnRails
[20:40:07] arup_r: dunpeal: what kind of arbitary file are those?
[20:41:04] dunpeal: arup_r: they define some convenience functions I use to do some analysis on the database.
[20:41:08] adamsilver: has joined #RubyOnRails
[20:41:15] JamesGames: has joined #RubyOnRails
[20:41:26] yoongkang: has joined #RubyOnRails
[20:41:52] arup_r: so you want it to run onyl when rails console launched not other times?
[20:44:48] apotry: has joined #RubyOnRails
[20:48:32] dunpeal: arup_r: yes.
[20:48:43] rubyonrails667: has joined #RubyOnRails
[20:48:47] watersoul: has joined #RubyOnRails
[20:49:07] rubyonrails667: hi, could someone help me with a very specific thing in rails 5?
[20:49:15] JamesGames: Hey peeps! Having a problem putting my array values into persistant storage. https://gist.github.com/anonymous/bd75d3784b7838cfcd03c0766201ea9f the joins table works... but my show table is not showing any change in the arrays
[20:49:15] eyck: has joined #RubyOnRails
[20:49:26] havenwood: rubyonrails667: ask away!
[20:49:51] arup_r: dunpeal: this may help you http://stackoverflow.com/a/19748275/2767755
[20:50:20] matthewd: dunpeal: http://api.rubyonrails.org/classes/Rails/Railtie.html#method-c-console
[20:50:27] havenwood: JamesGames: Using uniform whitespace makes it easier to spot nesting errors and for others to review your code.
[20:50:33] rubyonrails667: thanks havenwood! regarding the new scaffold generator in rails 5
[20:51:02] rubyonrails667: in the form references a variable for the model but not as an instance variable (no at sign)
[20:51:14] JamesGames: havenwood: ok. what do you think otherwise?
[20:51:29] rubyonrails667: why is that, beign that in rails 4 the same scaffold generator used to reference instance variables?
[20:52:18] dunpeal: matthewd: what does this method do?
[20:53:20] matthewd: dunpeal: Its block will be invoked when booting the console
[20:53:49] watersoul: has joined #RubyOnRails
[20:54:05] zacts: has joined #RubyOnRails
[20:54:39] matthewd: dunpeal: See under http://guides.rubyonrails.org/configuring.html#rails-general-configuration
[20:54:49] tubbo: JamesGames: doesn't seem like there's enough info there
[20:55:00] tubbo: JamesGames: like what is calling the function which runs the ajax request?
[20:55:20] JamesGames: tubbo: i can do like a minigist. to show u.
[20:56:07] tubbo: JamesGames: you can just add it to taht gist
[20:56:07] EXCHGR: question about mixing ERB and JSX (using react-rails). if i have this react component: http://hastebin.com/porohumaha.jsx (saved as _bookmark.js.jsx.erb) and this page that renders it: http://hastebin.com/udulurerus.erb, what's a good way to access this.props from within ERB tags in the react component? line 5 in the first link is an example of what i'm trying to do
[20:56:07] arup_r: dunpeal: yeah that is exactly what you needed .. I didn't know it
[20:57:02] tubbo: exchgr: i don't think you can, because the react component renders at a different time than ERB
[20:57:02] solars: has joined #RubyOnRails
[20:57:14] JamesGames: ok i give u the whole file.
[20:57:27] tubbo: the ERB is going to render on the server and then serve the entire html page to you. since the react component is on that html page, the browser will then load it.
[20:57:43] tubbo: exchgr: that said, you have to populate a react component with this.props so idk why you want to know?
[20:58:22] havenwood: exchgr: yup, that gets at the prop - an aside but why but the ".erb" final extension on your jsx file?
[20:58:27] EXCHGR: well what i'm trying to do is progressive enhancement (specifically have it work without JavaScript) but not have to duplicate template code
[20:58:50] watersoul: has joined #RubyOnRails
[20:58:57] pur3eval: has joined #RubyOnRails
[20:58:59] EXCHGR: havenwood: from what i understand, that helps the assets pipeline understand what it needs to compile
[20:59:12] tubbo: you're trying to do progressive enhancement...with a JAVASCRIPT framework? ;)
[20:59:19] EXCHGR: i know i know
[20:59:26] macsteps: has joined #RubyOnRails
[20:59:32] JamesGames: https://gist.github.com/anonymous/c6b7b0a594da075eb67c4dbc63c68e83 tubbo: and all the peeps
[20:59:42] tubbo: you got a good idea but i'm not sure react-rails does that, like i don't know if it renders components server-side first.
[20:59:49] neanderslob: has joined #RubyOnRails
[21:00:37] JamesGames: tubbo: u talking me?
[21:00:55] tubbo: JamesGames: are you using react-rails? :D
[21:01:10] JamesGames: tubbo: i see. as you were
[21:01:41] tubbo: JamesGames: so if those ajax requests just refresh the page anyway...what's the point?
[21:02:00] tubbo: can you verify that the ajax request gets made?
[21:02:08] neanderslob_: has joined #RubyOnRails
[21:02:25] JamesGames: well, if i get the item id onto the join table it should render in the view
[21:02:38] JamesGames: id like that but how?
[21:03:06] EXCHGR: tubbo: it renders server-side if you tell it to, like i do on line 7 of the second link
[21:03:37] neanderslob: has joined #RubyOnRails
[21:03:59] barhum2013: has joined #RubyOnRails
[21:04:09] JamesGames: again; u talking w me?
[21:04:13] tubbo: JamesGames: can you verify that the ajax request is being made?
[21:04:21] tubbo: JamesGames: if i'm talking to you i'll mention you, sound good? :)
[21:04:38] JamesGames: tubbo: how do i check the ajax?
[21:04:39] eyck: has joined #RubyOnRails
[21:04:56] tubbo: JamesGames: look at the JS Console's network tab and see if you see the POST request come through
[21:05:10] xall: has joined #RubyOnRails
[21:05:53] JamesGames: tubbo: , i do like, inspect element in the browser, or look at the rails console?
[21:06:45] tubbo: JamesGames: option+command+i in chrome, chrome dev tools.
[21:06:57] tubbo: welcome to heaven :)
[21:07:26] tubbo: or i guess it's ctrl+alt+i on windows/linux
[21:08:37] JamesGames: tubbo: Im doing ctrl+shift+k in firefox. Not sure what to look 4
[21:09:09] tubbo: JamesGames: sorry can't help you it's been too long since i used FF
[21:09:26] JamesGames: tubbo: i fire up Chrome then
[21:10:50] hahuang61: has joined #RubyOnRails
[21:12:26] Oliphaunte: has joined #RubyOnRails
[21:13:34] JamesGames: tubbo: ok. in console in chrome. how do i check ajax
[21:13:36] EXCHGR: ok so this seems to work (after adding view helpers to the assets pipeline) http://hastebin.com/ecajilufiv.jsx, but the href in the resulting anchor tag comes out as "{this.props.url}", even though the title is rendered correctly
[21:14:09] EXCHGR: and it even works without prerendering which is interesting
[21:15:55] toydestroyer: has joined #RubyOnRails
[21:16:14] Ropeney: has joined #RubyOnRails
[21:16:15] yfeldblum: has joined #RubyOnRails
[21:16:27] EXCHGR: html_safe had no effect
[21:16:29] n90b0jjf: has joined #RubyOnRails
[21:16:55] dunpeal: matthewd: thanks, that's great.
[21:17:30] l4v2: has joined #RubyOnRails
[21:18:28] barhum2013: has joined #RubyOnRails
[21:18:53] n90b0jjf: has joined #RubyOnRails
[21:19:11] tercenya: has joined #RubyOnRails
[21:19:34] xall_: has joined #RubyOnRails
[21:19:53] n90b0jjf: has joined #RubyOnRails
[21:21:07] Darmani: For some reason I rails thinks my :quantity attribute is a string and I'm not sure why.
[21:21:09] Darmani: https://gist.github.com/mfifth/01f352a23ff4fef4424b38ef1fe968e1#file-gistfile1-txt
[21:21:12] Darmani: Could someone take a look?
[21:21:24] abhinavmehta: has joined #RubyOnRails
[21:21:25] travismathis: has joined #RubyOnRails
[21:21:53] Oliphaunte: has joined #RubyOnRails
[21:21:57] mdw: has joined #RubyOnRails
[21:23:42] jhass: isn't it rather params[:quantity] that's a string?
[21:23:57] Mia: has joined #RubyOnRails
[21:23:57] Mia: has joined #RubyOnRails
[21:24:27] Darmani: jhass: Is it? D:
[21:24:31] Darmani: It shouldn't be...
[21:24:44] jhass: it actually should afaik
[21:25:07] c355E3B: has joined #RubyOnRails
[21:25:14] Darmani: uhh... What is afaik?
[21:25:27] jhass: As Far As I Know
[21:25:27] EXCHGR: "as far as I know"
[21:25:49] Darmani: Wait why? That doesn't help me I'm still confused T.T
[21:26:31] jhass: I actually never verified how it works, but I guess that say .find("11") converts the string implicitly
[21:26:37] jhass: and .increment just doesn't
[21:27:03] SteenJobs: has joined #RubyOnRails
[21:27:06] Darmani: jhass: nuuuuuuuuuuu q.q
[21:28:18] Darmani: jhass: Actually params[:quantity].to_i solves the problem.
[21:28:23] Darmani: I don't know why I didn't just think of that.
[21:28:25] jhass: so I'm right ;)
[21:28:34] Darmani: you are always right lol
[21:28:57] jhass: the trick is to only answer when you're fairly sure ;)
[21:29:11] Darmani: ACTION writes that down
[21:29:58] alfiemax: has joined #RubyOnRails
[21:30:17] tercenya: has joined #RubyOnRails
[21:33:07] Darmani: jhass: Okay I have one more for you, I have validations so that a person can't order 0 of an item. It gives them an error BUT if they already have one of that item in their cart and they order 0 of that item the error doesn't show :o
[21:33:15] Darmani: it just says item saved to cart.
[21:33:16] Darmani: https://gist.github.com/mfifth/01f352a23ff4fef4424b38ef1fe968e1#file-lineitem-rb
[21:35:15] jhass: dunno, how do you set it to 0?
[21:35:28] eyck_: has joined #RubyOnRails
[21:36:01] Darmani: it's a number field
[21:36:09] Darmani: so you can put any number you want I suppose.
[21:36:19] Darmani: jhass: https://tshirtshop-mfifth.c9users.io/shirts/2
[21:36:23] jhass: I mean in the controller
[21:36:39] mitt3ns: has joined #RubyOnRails
[21:36:52] dionysus69: has joined #RubyOnRails
[21:36:55] Darmani: jhass: In the controller...?
[21:37:40] jhass: is it the @existing_line_item stuff in create?
[21:38:20] Darmani: ummm @existing_line_item is just there to see if that item has already been ordered so I can increment it's value
[21:38:33] jhass: so, you have an existing one
[21:38:38] Darmani: otherwise if it's a unique item to the order then a new line item is created.
[21:38:44] jhass: then you add a "new" one with quantity 0
[21:39:22] Darmani: ACTION is confused
[21:39:26] jhass: it already exists, so you increment the existing one by 0
[21:39:35] jhass: which doesn't make the existing one invalid
[21:40:35] Darmani: jhass: Yes but if you enter 0 regardless of whether or not the order has that instance I figured it should always give an error.
[21:40:39] jhass: btw you probably just should do @order.variants.find_or_initialize_by(variant: @variant)
[21:40:44] Darmani: I mean that's what I wanted to happen.
[21:40:48] Cohedrin: has joined #RubyOnRails
[21:41:17] Darmani: jhass: What would that be for? o.o
[21:42:29] jhass: @line_item = @order.variants.create_with(quantity: 0).find_or_initialize_by(variant: @variant); @line_item.increment(:quantity, params[:quantity].to_i); if @line_item.save; ....
[21:42:53] jhass: and you just have to validate params[:quantity] in the controller I'm afraid
[21:43:08] theery: has joined #RubyOnRails
[21:44:05] jhass: eh, not @order.variants, @order.line_items
[21:44:06] Darmani: jhass: Thank you kindly, as always you have my gratitude ^^
[21:44:34] jhass: I'm confused why you have both
[21:45:06] Darmani: jhass: I have both? o.o
[21:45:47] jhass: maybe not mapped out for LineItem for some strange reason, but potentially
[21:46:03] eyck: has joined #RubyOnRails
[21:46:25] Darmani: ah Order has_many :variants, through: :line_items
[21:46:35] Darmani: and Order has_many :line_items as well.
[21:47:28] arBmind: has joined #RubyOnRails
[21:48:51] neanderslob: has joined #RubyOnRails
[21:49:24] tercenya: has joined #RubyOnRails
[21:50:29] adre: has joined #RubyOnRails
[21:51:22] oystersauce8: has joined #RubyOnRails
[21:51:31] jhass: Darmani: so something like that https://p.jhass.eu/4e.rb
[21:52:35] Darmani: jhass: That code looks so clean q.q
[21:53:08] n90b0jjf: has joined #RubyOnRails
[21:53:53] Oliphaunte: has joined #RubyOnRails
[21:56:04] Darmani: jhass: that looks gorgeous q.q
[21:58:03] habitullence: has joined #RubyOnRails
[21:58:21] jhass: Darmani: actually can skip the create_with, increment initializes to 0
[21:59:07] Darmani: jhass: 10-4
[22:00:22] EXCHGR: so erb seems to be rendering this: http://hastebin.com/iyoperepuc.js from this: http://hastebin.com/ecajilufiv.jsx
[22:00:29] cd-rum: has joined #RubyOnRails
[22:00:36] Darmani: jhass: What does return do? on line 5?
[22:01:03] jhass: Darmani: make sure no code behind it is executed anymore
[22:01:05] EXCHGR: that's almost what i want, except i want href's value to not have quotes around it. how would i get that?
[22:01:09] jhass: it returns from the method
[22:01:32] EXCHGR: (well, i guess erb and babel)
[22:01:44] Darmani: jhass: oh so like the rest of the code doesn't get evaluated?
[22:02:01] jhass: executed, yes
[22:02:15] Darmani: jhass: Why is that necessary? o.o
[22:02:29] danman: has joined #RubyOnRails
[22:02:32] jhass: because we don't want any of the other code to run in that case
[22:02:56] jhass: else we get a double render
[22:03:00] Darmani: jhass: Isn't that why we have a redirect to the root_path? I would assume the code stops there anyway...
[22:03:29] jhass: no, redirect_to is just a method call, it does not return from the method (it can't, it's not possible in Ruby)
[22:03:49] jhass: exchgr: your two pastes don't seem to match up much at all
[22:04:09] Darmani: jhass: got it ^.^
[22:04:23] EXCHGR: jhass: they do, it's just that babel transforms it almost beyond recognition
[22:05:03] EXCHGR: the part to focus on is line 5 in the first paste and lines 9-14 in the second
[22:05:34] cd-rum: has joined #RubyOnRails
[22:05:49] jhass: pretty sure it's a babel (whatever that is) issue, not a erb or rails issue
[22:05:53] EXCHGR: i'm thinking erb transforms it to <a href=... (in jsx) and then babel transforms it into a react element
[22:06:48] dkam__: has joined #RubyOnRails
[22:07:11] Darmani: jhass: On line 8 of that code you posted... Why do you call find_or_initialize_by on the array of order.line_items?
[22:07:19] Darmani: I would think that's supposed to be called on the model.
[22:08:21] jhass: Darmani: @order.line_items is not an array, it's an ActiveRecord::Relation
[22:09:21] Darmani: ACTION raises hand
[22:09:25] Darmani: teacher I have a question.
[22:09:58] Darmani: actually.. I'll look it up.
[22:09:58] adavia: How can i subscribe to a channel with actioncable after an ajax request?
[22:10:32] Darmani: jhass: fuck it I'll just ask, what's an ActiveRecord::Relation?
[22:12:28] adavia: i believe its an ActiveRecord::Association
[22:13:01] Darmani: adavia: But what does it return exactly? It's not an array, it's not an instance...
[22:13:45] jhass: no, it's ActiveRecord::Relation
[22:14:00] jhass: and it's sort of a god object as in it's doing more than one thing
[22:14:42] havenwood: Darmani: If you don't know what class a thing is, ask it its class, like: p @order.class
[22:14:43] jhass: 1) it provides the chainable query interface, Foo.where(..).order(..), here where returns an AR::Relation, order returns an AR::Relation
[22:15:04] jhass: from which the final SQL query is built
[22:15:18] jhass: associations thus return one too
[22:15:37] jhass: but the parameters accumulated for its second usecase, initializing new records based on them
[22:15:47] jhass: *are also used for its
[22:16:27] sdwrage: has joined #RubyOnRails
[22:16:30] Darmani: jhass: hmmmmm
[22:17:54] tercenya: has joined #RubyOnRails
[22:20:09] Darmani: jhass: Wow I'm literally still in awe of your code.
[22:20:30] Darmani: god mine looks like it was written by an kindergartener Q.Q
[22:22:45] dvinciguerra_: has joined #RubyOnRails
[22:25:22] Darmani: Regardless I'm almost done for today, thank you for your help once again jhass ^.^
[22:27:06] Jayson_Virissimo: has joined #RubyOnRails
[22:28:09] Ebok: has joined #RubyOnRails
[22:29:20] MrPunkin: has joined #RubyOnRails
[22:30:08] abhinavmehta: has joined #RubyOnRails
[22:31:11] asianMike: has joined #RubyOnRails
[22:32:35] MrPunkin: Are ranges a reliable attribute format for a Active Model model that’s based on returning projected data? It has a few date windows that ranges would be good for, but is it more reliable to make the start / end of each window it’s own attribute? Is there additional overhead with ranges or anything?
[22:33:05] eyck: has joined #RubyOnRails
[22:33:30] MrPunkin: I guess as far as serlialization and such they wouldn’t be good, kind of answering my own question here thinking about it
[22:33:37] SteenJobs: has joined #RubyOnRails
[22:34:52] Cohedrin: has joined #RubyOnRails
[22:36:59] djbkd: has joined #RubyOnRails
[22:39:01] conta: has joined #RubyOnRails
[22:43:08] yoongkang: has joined #RubyOnRails
[22:46:20] xploshioon: has joined #RubyOnRails
[22:48:25] roamingdog: has joined #RubyOnRails
[22:51:26] xploshioon: hello guys, I am trying to run a migration and it says
[22:51:28] xploshioon: ActiveRecord::StatementInvalid: PG::DatatypeMismatch: ERROR: column "geared" cannot be cast automatically to type boolean
[22:51:28] xploshioon: HINT: You might need to specify "USING geared::boolean".
[22:51:44] xploshioon: something like this?
[22:51:45] xploshioon: t.change :geared, "USING geared::boolean", :default => false
[22:52:05] jgpawletko: has joined #RubyOnRails
[22:56:35] superlou: has joined #RubyOnRails
[22:59:25] eyck: has joined #RubyOnRails
[22:59:41] jstransky: has joined #RubyOnRails
[23:04:18] fructose: has joined #RubyOnRails
[23:04:24] SteenJobs: here goes again - anyone use Upstart for monitoring God (ha!)?
[23:05:29] werwe: has joined #RubyOnRails
[23:05:32] werwe: https://i.redd.it/6um66531guax.jpg3
[23:05:34] werwe: https://i.redd.it/6um66531guax.jpg
[23:05:34] werwe: https://i.redd.it/6um66531guax.jpg
[23:06:14] asianMike: has left #RubyOnRails: ()
[23:06:42] ChanServ: +o havenwood
[23:06:43] ChanServ: +o havenwood
[23:06:52] havenwood: +b *!~werwer@80.107.85.106
[23:07:02] ChanServ: -o havenwood
[23:10:29] jonyijoe: has joined #RubyOnRails
[23:10:41] fructose: Does anyone know if Rails has a similar concept to widgets in Yii? I'm wondering if there is a way to generate HTML in a Bootstrap-compatible way, but I'm not finding anything
[23:11:36] jonyijoe: do you mean the views generated from scaffolding controllers?
[23:12:28] hahuang61: has joined #RubyOnRails
[23:12:42] ChanServ: +o havenwood
[23:12:46] jonyijoe: Anyone here scoped devise logins inside a resource?
[23:12:57] fructose: jonyijoe: That sounds like large-scale code generation. I'm thinking of a single line that might output a single Bootstrap component
[23:13:16] banisterfiend: has joined #RubyOnRails
[23:14:37] jonyijoe: Fructose I typically use the render helper to reuse custom html components
[23:14:43] ChanServ: -o havenwood
[23:15:37] jonyijoe: for example <%= render 'common/notification', data:notification %> << using this inside an each block and passing data into the component
[23:17:29] jonyijoe: Anyone here scoped devise user accounts within a resource?
[23:19:53] arquebus: has joined #RubyOnRails
[23:23:31] Ropeney: has joined #RubyOnRails
[23:23:38] cleopatra: has joined #RubyOnRails
[23:25:51] macsteps: has joined #RubyOnRails
[23:28:29] douglascorrea: has joined #RubyOnRails
[23:34:47] chipotle: has joined #RubyOnRails
[23:39:02] abhinavmehta: has joined #RubyOnRails
[23:41:46] DoctorMonocular: has joined #RubyOnRails
[23:44:03] yoongkang: has joined #RubyOnRails
[23:47:16] n90b0jjf: has joined #RubyOnRails
[23:47:23] queuetip: has joined #RubyOnRails
[23:47:45] glasz_: has joined #RubyOnRails
[23:48:14] yoongkang: has joined #RubyOnRails
[23:48:51] dalbuschat: has joined #RubyOnRails
[23:48:56] queuetip: hi, i'm working on a grape app and i'm entirely noob with ruby, i was trying to add request.body to Rails.logger.info "\n\n*****\nEnd Point #{env['api.endpoint']} to log the entire request along with the endpoint, but failing miserably, can anyone tell me what i'm doing wrong
[23:51:49] Leepoff: has joined #RubyOnRails
[23:52:00] solars: has joined #RubyOnRails
[23:52:18] roamingdog: has joined #RubyOnRails
[23:56:02] axl_: has joined #RubyOnRails
[23:56:34] quazimodo: has joined #RubyOnRails
[23:58:47] lunaelli: has joined #RubyOnRails