« Back to channel list

#RubyOnRails - 04 May 2017

« Back 1 day Forward 1 day »
[00:07:23] patarr: has joined #RubyOnRails
[00:07:35] jon31: has joined #RubyOnRails
[00:07:56] chouhoulis: has joined #RubyOnRails
[00:09:00] Technodrome: has joined #RubyOnRails
[00:12:01] Ellimist: has joined #RubyOnRails
[00:20:18] ravster: I'm looking for an alternative to devise for user-authentication. I would like something that works with the rails-views as well as an api. Does anyone have suggestions for me to check out?
[00:20:44] podman: has joined #RubyOnRails
[00:20:47] mattwc: has joined #RubyOnRails
[00:21:16] Iacobus: has joined #RubyOnRails
[00:21:24] patarr: has joined #RubyOnRails
[00:36:01] brent__: has joined #RubyOnRails
[00:37:20] Technodrome: has joined #RubyOnRails
[00:37:39] ahrs: has joined #RubyOnRails
[00:44:29] Aytan72: has joined #RubyOnRails
[00:53:40] mostlybadfly: hey all, does anyone have experience with the RSpotify gem? I'm attempting to check for a 200 response code prior to rendering a view. Any suggestions for how to accomplish this? Issue is that if a user deauthorizes Spotify on my app, it will cause issues in one of my views unless I do a check prior.
[00:54:03] mostlybadfly: or I guess conversely check for a 401 error prior to completing further actions
[00:58:11] PresidentBiscuit: has joined #RubyOnRails
[01:04:55] mjora7: has joined #RubyOnRails
[01:06:59] duderonomy: has joined #RubyOnRails
[01:11:38] aajjbb: has joined #RubyOnRails
[01:18:38] mjora7: has joined #RubyOnRails
[01:20:16] andrew9184: is there a way to fix deep munge? ie empty arrays stay as arrays instead of being nil
[01:22:49] PresidentBiscuit: has joined #RubyOnRails
[01:29:55] duderono_: has joined #RubyOnRails
[01:30:22] uks: has joined #RubyOnRails
[01:45:47] tetraktys: has joined #RubyOnRails
[01:46:30] iliketurtles: has joined #RubyOnRails
[01:57:14] sevenseacat: has joined #RubyOnRails
[02:04:35] quazimodo: has joined #RubyOnRails
[02:04:45] ahrs: has joined #RubyOnRails
[02:05:04] libastral: has joined #RubyOnRails
[02:05:42] quirkycoders: has joined #RubyOnRails
[02:06:34] Technodrome: has joined #RubyOnRails
[02:07:41] PresidentBiscuit: has joined #RubyOnRails
[02:14:04] Jameser: has joined #RubyOnRails
[02:25:21] petrol_gas: has joined #RubyOnRails
[02:28:29] andrevan: has joined #RubyOnRails
[02:28:54] petrol_gas: Can someone point me to migration column types in the API Docs? I found the following link to add_column. The doc refers to native types, but not where they're defined. I want to read the options for each of the native types.
[02:29:02] petrol_gas: The link: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_column
[02:34:32] akshat: has joined #RubyOnRails
[02:40:37] Radar: GOOD MORNING
[02:40:46] Radar: IT'S ACTUALLY AFTERNOON NOW
[02:40:52] sevenseacat: not here it isnt.
[02:42:34] irishfromua: has joined #RubyOnRails
[02:43:09] mjora7: has joined #RubyOnRails
[02:45:25] Aytan72: has joined #RubyOnRails
[02:46:40] duderonomy: has joined #RubyOnRails
[02:46:42] quirkycoders: has joined #RubyOnRails
[02:50:56] iliketurtles: has joined #RubyOnRails
[02:57:52] maddman: has joined #RubyOnRails
[02:58:34] maddman: hi there! I'm with problems to install rails on windows 10. Someone can help me?
[02:59:01] szulak: has joined #RubyOnRails
[02:59:56] fryguy: maddman: you aren't going to like this answer, but you'll be much better served by running rails on another operating system
[03:00:17] sevenseacat: maddman: if you gist your error, we might be able to help.
[03:00:25] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[03:00:28] sandstrom: has joined #RubyOnRails
[03:02:39] romeoh: has joined #RubyOnRails
[03:03:23] romeoh_: has joined #RubyOnRails
[03:03:32] AntiSpamMeta2: has joined #RubyOnRails
[03:04:08] fcser__: has joined #RubyOnRails
[03:07:30] maddman: sevenseacat, fryguy, https://gist.github.com/ramoel/d9997160644424171c2627edf2e0b4cb
[03:09:28] sevenseacat: https://github.com/rubygems/rubygems/issues/1540 as silly as it sounds... rebooting seems to fix it?
[03:09:34] watersoul_: has joined #RubyOnRails
[03:10:52] maddman: sevenseacat, I'll try.
[03:11:15] sevenseacat: let us know how it goes!
[03:12:08] irishfromua: has joined #RubyOnRails
[03:12:52] irishfromua: has joined #RubyOnRails
[03:13:48] mjora7: has joined #RubyOnRails
[03:16:30] mjora7: has joined #RubyOnRails
[03:16:41] petrol_gas: Well it was worth a shot. Thanks anyways gents.
[03:16:59] petrol_gas: has left #RubyOnRails: ()
[03:18:32] sevenseacat: sorry the men couldn't help you, petrol_gas.
[03:18:35] sevenseacat: oh, they left.
[03:18:39] maddman: has joined #RubyOnRails
[03:18:59] maddman: sevenseacat, rebooting works with bundle install. Thansk!
[03:20:10] andrevan: has joined #RubyOnRails
[03:27:30] tetraktys: has joined #RubyOnRails
[03:35:53] k13nox: has joined #RubyOnRails
[03:45:43] quirkycoders: has joined #RubyOnRails
[03:46:09] romeoh: has joined #RubyOnRails
[03:50:40] romeoh: has joined #RubyOnRails
[03:53:54] Jayson_Virissimo: has joined #RubyOnRails
[04:01:07] dminuoso: sevenseacat: Reading the related SO posts, it's one of those big reasons why cygwin sucks quite a bunch.
[04:14:18] smoitra: has joined #RubyOnRails
[04:25:17] zachary12: has joined #RubyOnRails
[04:31:44] mjora7: has joined #RubyOnRails
[04:39:53] uksio: has joined #RubyOnRails
[04:41:03] tetraktys: has joined #RubyOnRails
[04:43:39] Ellimist: has joined #RubyOnRails
[04:46:15] Aytan72: has joined #RubyOnRails
[04:51:02] romeoh: has joined #RubyOnRails
[05:01:21] jeyraof^mbpr: has joined #RubyOnRails
[05:05:49] PresidentBiscuit: has joined #RubyOnRails
[05:09:00] Radar: I thought Bash On Windows was going to Revolutionize Everything™
[05:09:39] Technodrome: has joined #RubyOnRails
[05:09:57] sevenseacat: it will, but maddman wasnt using it
[05:13:01] podman: has joined #RubyOnRails
[05:13:10] Iacobus: has joined #RubyOnRails
[05:15:34] dionysus69: has joined #RubyOnRails
[05:26:46] srinidhi: has joined #RubyOnRails
[05:30:35] AzaToth: has joined #RubyOnRails
[05:33:42] aseibert: has joined #RubyOnRails
[05:37:20] k13nox: has joined #RubyOnRails
[05:52:00] User458764: has joined #RubyOnRails
[05:52:02] romeoh: has joined #RubyOnRails
[05:53:36] User458764: has joined #RubyOnRails
[05:55:21] iliketurtles: has joined #RubyOnRails
[05:56:57] ^mtkd: has joined #RubyOnRails
[06:06:50] mjora7: has joined #RubyOnRails
[06:13:35] morfin: has joined #RubyOnRails
[06:13:50] morfin: question not exactly about RoR but about Puma i use
[06:14:36] morfin: If i restart puma with pumactl it does not daemonize process unless i use daemonize true in config/puma.rb is that right thing?
[06:15:10] morfin: i had to check environment i use to run application to avoid daemonization
[06:16:45] srinidhi: has joined #RubyOnRails
[06:35:27] conta: has joined #RubyOnRails
[06:42:25] kristofferR: has joined #RubyOnRails
[06:47:05] Aytan72: has joined #RubyOnRails
[06:50:16] Pumukel: has joined #RubyOnRails
[06:51:30] User458764: has joined #RubyOnRails
[06:51:46] mtkd: has joined #RubyOnRails
[06:52:20] rgr_: has joined #RubyOnRails
[06:53:06] romeoh: has joined #RubyOnRails
[07:03:58] armyriad: has joined #RubyOnRails
[07:05:03] __Raiden__: has joined #RubyOnRails
[07:09:26] Technodrome: has joined #RubyOnRails
[07:16:00] tetraktys: has joined #RubyOnRails
[07:17:47] username1: has joined #RubyOnRails
[07:23:36] sandstrom: has joined #RubyOnRails
[07:29:55] k13nox: has joined #RubyOnRails
[07:30:40] tbuehlmann: has joined #RubyOnRails
[07:42:56] __Raiden__: has joined #RubyOnRails
[07:53:39] PresidentBiscuit: has joined #RubyOnRails
[07:53:53] romeoh: has joined #RubyOnRails
[07:57:07] patarr: has joined #RubyOnRails
[08:03:26] blackmesa: has joined #RubyOnRails
[08:03:54] k13nox: has joined #RubyOnRails
[08:03:59] mikecmpbll: has joined #RubyOnRails
[08:04:42] arBmind: has joined #RubyOnRails
[08:05:25] marr: has joined #RubyOnRails
[08:30:47] newton: has joined #RubyOnRails
[08:45:39] mahloun: has joined #RubyOnRails
[08:46:18] jlpeters: has joined #RubyOnRails
[08:48:02] Aytan72: has joined #RubyOnRails
[08:49:42] Subfusc: has joined #RubyOnRails
[08:54:23] mjora7: has joined #RubyOnRails
[08:54:45] romeoh: has joined #RubyOnRails
[09:01:03] lxsameer: has joined #RubyOnRails
[09:04:53] lipoqil: has joined #RubyOnRails
[09:21:02] vayan: has joined #RubyOnRails
[09:31:32] shotbug: has joined #RubyOnRails
[09:45:27] tetraktys: has joined #RubyOnRails
[09:51:50] mattwc: has joined #RubyOnRails
[09:53:15] v|sh: has joined #RubyOnRails
[09:56:26] dmnd: has joined #RubyOnRails
[09:56:36] ferr: has joined #RubyOnRails
[09:58:00] patarr: has joined #RubyOnRails
[09:58:01] Iacobus: has joined #RubyOnRails
[10:06:16] kumavis: has joined #RubyOnRails
[10:09:59] arBmind: has joined #RubyOnRails
[10:10:27] soahccc: has joined #RubyOnRails
[10:18:34] soahccc: Hey guys, is there an easy way to alter the response if basic auth goes 401? I tried http://stackoverflow.com/a/7640418/1806803 but I still get the 401 response: https://gist.github.com/2called-chaos/69c6a7d43033d8a2e8ed12f136df3b29
[10:28:24] dionysus69: has joined #RubyOnRails
[10:34:57] User458764: has joined #RubyOnRails
[10:35:29] User458764: has joined #RubyOnRails
[10:37:34] srinidhi: has joined #RubyOnRails
[10:41:23] PresidentBiscuit: has joined #RubyOnRails
[10:45:39] Kilo`byte: hai there, with the postgresql adapter, can i somehow execute raw prepared/parametrized statements
[10:46:37] mtkd: has joined #RubyOnRails
[10:51:31] futilegames: has joined #RubyOnRails
[10:56:17] romeoh: has joined #RubyOnRails
[10:58:12] DaveTaboola: has joined #RubyOnRails
[11:11:46] DaveTaboola: has joined #RubyOnRails
[11:18:32] username1: has joined #RubyOnRails
[11:31:05] hndk: has joined #RubyOnRails
[11:45:08] DaveTaboola: has joined #RubyOnRails
[11:48:51] aajjbb: has joined #RubyOnRails
[11:53:02] manzo: has joined #RubyOnRails
[11:56:14] kristofferR: has joined #RubyOnRails
[11:56:54] romeoh: has joined #RubyOnRails
[11:58:54] patarr: has joined #RubyOnRails
[12:04:31] romeoh: has joined #RubyOnRails
[12:05:27] romeoh_: has joined #RubyOnRails
[12:08:57] patarr: has joined #RubyOnRails
[12:12:53] wethu: has joined #RubyOnRails
[12:15:42] arBmind: has joined #RubyOnRails
[12:17:13] AntiSpamMeta: has joined #RubyOnRails
[12:19:53] tetraktys: has joined #RubyOnRails
[12:20:49] marr: has joined #RubyOnRails
[12:28:01] jlebrech: has joined #RubyOnRails
[12:29:11] jlebrech: I have a angular 1.x frontend and want to put it in my backend rails 5.1 app. does rails 5.1 also work with angular 1.x as it does with 2
[12:31:12] Aytan72: has joined #RubyOnRails
[12:33:18] oddalot: has joined #RubyOnRails
[12:45:37] oddalot: has joined #RubyOnRails
[12:57:28] xall: has joined #RubyOnRails
[12:59:26] xall: has joined #RubyOnRails
[13:03:54] blackmesa: has joined #RubyOnRails
[13:07:44] Criten: Anyone here contribute to webpacker at all?
[13:08:01] Criten: I want to discus a possible proxy through the rails app to access the compiled packs
[13:08:14] jlebrech: Criten: i'm not sure i just asked a webpacker question
[13:08:37] Criten: jlebrech: it just uses webpack, so all of that should work fine
[13:08:46] Criten: anything you can do with webpack should be supported
[13:08:57] jlebrech: even old ass angular code?
[13:08:59] Criten: it might not have a nice scafold for it
[13:09:18] Criten: What precompile steps does angular 1 use?
[13:09:32] Criten: Pretty just its just js modules? What does it use for templates?
[13:09:35] jlebrech: i want to use rails to let old angular and new angular live side by side without going though a full upgrade
[13:09:36] Criten: I've never used it
[13:10:35] Criten: You could definitly have one pack for the old app and another for the new one
[13:15:49] jlebrech: yeah, i really want this. no upgrade path from angular 1.x to 2 is baaaaad
[13:20:14] AntiSpamMeta: has joined #RubyOnRails
[13:23:19] Criten: jlebrech: yeah, its basically a full rewrite from 1 -> 2
[13:23:40] PresidentBiscuit: has joined #RubyOnRails
[13:24:41] jlebrech: Criten: i don't even want to trust angular if the upgrade path sucks so much. 2-4 upgrade seems better. but with rails 5.1 we could write the js in anything :)
[13:25:27] Criten: I doubt they would have such a breaking release again... but who knows!
[13:27:30] mustmodify: Angular 2's breakage is what gave me the opportunity to try out React. So I thought overall it was good for me. :)
[13:27:45] Criten: I've been using vuejs, for an electron app, lately and its super clean
[13:27:59] Criten: haha nice mustmodify
[13:29:58] jlebrech: Criten: yeah, vue looks pretty.
[13:30:49] jlebrech: i just don't understand why i need to written cargo cult bootstraping magic to write an app. everything i write should be about my app and the rest should be managed by the framework.
[13:31:41] mustmodify: cargo cult bootstrapping magic?
[13:31:43] Jameser: has joined #RubyOnRails
[13:31:43] jlebrech: the cargo cult wrote a lot of nice stuff for me to piggyback off, but now everyone has seen the light
[13:33:11] gaucheph: has joined #RubyOnRails
[13:33:19] jlebrech: yeah, like dependency injection, providers, nginject, $scope, writting directives. 1 was very odd.
[13:34:53] DLSteve: has joined #RubyOnRails
[13:35:05] cybex_: has joined #RubyOnRails
[13:41:03] pwnd_nsfw: has joined #RubyOnRails
[13:42:36] planigan: has joined #RubyOnRails
[13:45:49] cpruitt: has joined #RubyOnRails
[13:51:21] quirkycoders: has joined #RubyOnRails
[13:53:54] Technodrome: has joined #RubyOnRails
[14:00:50] pulkit4tech: has joined #RubyOnRails
[14:01:40] ravster: has joined #RubyOnRails
[14:02:29] vedu: Hello. How can I send a blank value from my f.number_field ?
[14:10:00] pupsicle: has joined #RubyOnRails
[14:11:19] cpruitt: has joined #RubyOnRails
[14:17:41] theunraveler: has joined #RubyOnRails
[14:24:42] ravster: vedu: you mean like a nil?
[14:27:35] vedu: ravster: yeah
[14:28:38] xall: has joined #RubyOnRails
[14:30:46] Ergo: has joined #RubyOnRails
[14:30:57] mrbubbles: has joined #RubyOnRails
[14:32:01] rgr_: has joined #RubyOnRails
[14:32:04] mrbubbles: hey folks, I'm trying to debug a spree checkout. I'm getting an error about $(...).validate is not a function but I've checked and I can see that the script is included in the page
[14:32:44] mrbubbles: I've also compared this install (which is modified) to a clean spree install and the scripts match so I'm not sure what's going on. Could it be down to the asset pipeline?
[14:33:24] KeyJoo: has joined #RubyOnRails
[14:35:44] Technodrome: has joined #RubyOnRails
[14:40:35] tetraktys: has joined #RubyOnRails
[14:41:23] y2mq37: has joined #RubyOnRails
[14:42:01] chouhoulis: has joined #RubyOnRails
[14:42:06] rgr: has joined #RubyOnRails
[14:42:18] patarr: has joined #RubyOnRails
[14:42:37] mikecmpb_: has joined #RubyOnRails
[14:43:16] ravster: vedu: How about just making the field a 'nil' by default?
[14:45:14] Cesario__: has joined #RubyOnRails
[14:46:31] xall: has joined #RubyOnRails
[14:47:09] mostlybadfly: has joined #RubyOnRails
[14:48:48] Cesariox: has joined #RubyOnRails
[14:49:11] creature: has joined #RubyOnRails
[14:56:15] choke: has joined #RubyOnRails
[14:58:18] polishdub: has joined #RubyOnRails
[15:00:30] vedu: ravster: I did hack it already. But I want to set it to nil on update, based on a related radio button. So once it gets a value, I cannot set it to nil
[15:02:48] mrbubbles: Ah - it looks like jQuery is being loaded twice, once by the app and then once by spree. Hmmm
[15:04:36] arup_r: has joined #RubyOnRails
[15:12:14] mikecmpbll: has joined #RubyOnRails
[15:12:38] xall: has joined #RubyOnRails
[15:13:15] linetrace: has joined #RubyOnRails
[15:16:39] User458764: has joined #RubyOnRails
[15:17:21] blackmesa: has joined #RubyOnRails
[15:20:17] mustmodify: has left #RubyOnRails: ()
[15:24:46] xall: has joined #RubyOnRails
[15:25:09] xall: has joined #RubyOnRails
[15:29:06] bennyzr: has joined #RubyOnRails
[15:31:03] djbkd: has joined #RubyOnRails
[15:31:55] bennyzr: Hi, can anyone help me with monkey patching a form helper gem? I tried creating middleware to add the patch and am getting an "A copy of [middleware] has been removed from the module tree but is still active" error.
[15:32:41] patarr1: has joined #RubyOnRails
[15:33:45] ltd: has joined #RubyOnRails
[15:34:37] xall: has joined #RubyOnRails
[15:35:13] brent__: has joined #RubyOnRails
[15:36:02] arBmind: has joined #RubyOnRails
[15:40:38] NeoMalachi: has joined #RubyOnRails
[15:46:11] gusrub: has joined #RubyOnRails
[15:48:38] gusrub: has joined #RubyOnRails
[15:51:23] xall: has joined #RubyOnRails
[15:55:39] [Butch]: has joined #RubyOnRails
[15:57:32] xall_: has joined #RubyOnRails
[16:01:33] patarr: has joined #RubyOnRails
[16:03:58] blackmesa: has joined #RubyOnRails
[16:10:23] username1: has joined #RubyOnRails
[16:10:33] mtkd: has joined #RubyOnRails
[16:12:40] fernandomm: has joined #RubyOnRails
[16:14:53] FastJack: has joined #RubyOnRails
[16:22:28] greengriminal: has joined #RubyOnRails
[16:23:22] greengriminal: Hey, does anyone have any thoughts on why this migration maybe failing: https://gist.github.com/davidpatters0n/b2a5c778bff82ab5d057fb7cace8873f I'm using postgres. Also have looked at similar questions on SO and they don't seem related.
[16:33:49] mustmodify: has joined #RubyOnRails
[16:34:11] mustmodify: Can I override the #count method on a scope with group_by?
[16:34:16] mustmodify: so it'll ...
[16:34:23] mustmodify: work instead of giving me back a hash?
[16:37:50] newton: has joined #RubyOnRails
[16:39:29] Iacobus: has joined #RubyOnRails
[16:39:49] vayan: has joined #RubyOnRails
[16:39:53] kumavis: has joined #RubyOnRails
[16:40:10] dmnd: has joined #RubyOnRails
[16:40:41] jlpeters: has joined #RubyOnRails
[16:40:42] pLaTo0n: has joined #RubyOnRails
[16:41:03] mattwc: has joined #RubyOnRails
[16:45:54] Pumukel: has joined #RubyOnRails
[16:47:33] Orxata_: has joined #RubyOnRails
[16:48:48] Orxata_: I'm working on an app which has a route like host.name.com/#account
[16:49:03] Orxata_: what does the "#account" mean?
[16:49:20] mustmodify: that's a reference to a page anchor
[16:49:40] mustmodify: it means to scroll down in the page to where that ID or anchor exists.
[16:49:42] KeyJoo: it's ancnor for current id
[16:50:18] Orxata_: which ID? account?
[16:50:20] KeyJoo: you need put in tag id
[16:50:54] pwnd_nsfw: "#identifier" is used for serveral things nowadays, but originally it was an anchor like mustmodify describes
[16:51:03] User458764: has joined #RubyOnRails
[16:51:10] mustmodify: Orxata_: check this out.
[16:51:11] mustmodify: https://github.com/mustmodify/valuable#frequent-uses
[16:51:15] mustmodify: inspect that page.
[16:51:16] KeyJoo: see: <div id="Contacts">Text...</div>
[16:51:31] mustmodify: See how it starts not-at-the-top?
[16:51:38] User458764: has joined #RubyOnRails
[16:52:16] mustmodify: Orxata_: What do you see when you click on that link?
[16:52:29] mustmodify: The very top thing for me is the title "Frequent Uses"
[16:52:45] mustmodify: That's not the top of that page.
[16:52:50] mustmodify: You can scroll up to see other stuff.
[16:52:51] KeyJoo: you dont reload this page on webserver
[16:52:54] Orxata_: I think we are not talking about the same thing
[16:52:57] lacrosse: has joined #RubyOnRails
[16:53:07] mustmodify: So how did #frequent-uses make it scroll there?
[16:53:09] Orxata_: in particular, in my app there's this route: "host.name.com/#account/login"
[16:53:18] Orxata_: also, there's no ID for #account
[16:53:31] Orxata_: it's like a "strange" route
[16:53:42] mustmodify: It's a javascript route.
[16:53:55] mustmodify: YOu're using some javascript framework.
[16:55:14] Orxata_: I'm using underscore, less... for client-side
[16:56:18] Orxata_: no frameworks
[16:56:26] lacrosse: has left #RubyOnRails: ()
[16:57:05] Orxata_: before using express there was that #
[16:57:18] mustmodify: when you say it's a "strange" route... what does that mean?
[16:57:35] Orxata_: we have a controller named "account"
[16:57:46] mustmodify: I assume it isn't configured in config/routes.rb because Rails won't get information after a #, IIRC.
[16:58:07] Orxata_: it isn't configured. Should be?
[16:58:13] Orxata_: because right now it's working properly
[16:58:45] hennign: has joined #RubyOnRails
[16:59:23] mustmodify: Orxata_: At this point, I suspect you're in the "I don't know enough to know what I don't know" camp. It's a hard place to be. Stay in the struggle. You'll get there.
[16:59:50] Orxata_: My only option at this point is to ask my team manager
[17:00:48] otherj: has joined #RubyOnRails
[17:01:37] Orxata_: thanks anyway
[17:09:25] mustmodify: has left #RubyOnRails: ()
[17:20:59] sunya7a: hello all. Could someone help me with the following query: https://gist.github.com/anonymous/24d3ef0be8f41d0d6aff7a7bbc951190
[17:21:20] sunya7a: I'm wondering if there's a way to combine loading the user: :profile instead of calling it twice
[17:27:05] kies^: has joined #RubyOnRails
[17:28:55] bennyzr: has joined #RubyOnRails
[17:29:39] bennyzr: Hi, what's the best way to add a method to an existing module in a gem using a patch?
[17:40:39] bennyzr: has joined #RubyOnRails
[17:47:08] defsdoor: has joined #RubyOnRails
[18:03:41] nir0: has joined #RubyOnRails
[18:04:49] nir0: hi guys, i've got a method can?(permission) in application_controller, helper_method on it. now i cannot stub it from view spec
[18:06:13] nir0: without stub it says undefined method can?
[18:07:16] nir0: if i try to stub it, it goes with errors, like i'm missing some gem. any solution, like view.stub() just throws undefined method stub
[18:09:07] nir0: view.stub(:can?).and_return(:false) throws undefined method `stub' for #<#<Class:0...>
[18:13:04] ^mtkd: has joined #RubyOnRails
[18:18:55] v|sh: has joined #RubyOnRails
[18:19:09] User458764: has joined #RubyOnRails
[18:21:25] nir0: allow(view).to receive(:can?).and_return(false) says view does not implement: can?
[18:27:11] bryanculver: has joined #RubyOnRails
[18:28:52] bryanculver: I'm wondering if there is a better way than brute forcing this search: I'm looking for clubs that people have in common through their list of memberships
[18:29:27] bryanculver: CLUB -(0-N)-> CLUB_MEMBERS <-(0-N)- USERS
[18:29:53] bryanculver: These are both set up via a has_many relationship, along with the throughs
[18:30:15] bryanculver: Is there a better way than grabbing all clubs for all users then filtering through each to determine if it contains all users?
[18:31:27] nir0: bryanculver: you could use some sql to make it faster, depends on what particulary you want to achieve
[18:32:09] bryanculver: I can think of one "short cut" as I'm trying to really just tell if it's boolean (in common or not) of grabbing the first users groups, then stepping though each user and "narrowing" down the list until no groups in common or no users left to check
[18:33:19] blackmesa: has joined #RubyOnRails
[18:33:41] bryanculver: I'm just wondering if a) RoR has a AR helper for this (don't want to reinvent the wheel) or if a SQL query will be markedly faster.
[18:38:39] gusrub: has joined #RubyOnRails
[18:41:40] agent_white: has joined #RubyOnRails
[18:41:41] srinidhi: has joined #RubyOnRails
[18:42:45] gusrub: has joined #RubyOnRails
[18:45:02] duderonomy: has joined #RubyOnRails
[18:45:42] ravster: bryanculver: I'm not sure what you want to achieve. Can you walk us through an example?
[18:46:24] bryanculver: Ok so I have a Chat and I want to determine if all members are in the same club or if they are from different clubs
[18:46:57] bryanculver: Any user can be a part of any number of clubs and any club can have an arbitrary number of members, always changing on both
[18:47:48] mahloun: has joined #RubyOnRails
[18:47:48] bryanculver: I using this "filter" to determine of this chat is exclusive to the club or if someone has invited someone from outside of the club
[18:47:52] ravster: So you want two different lists of users? Or if the user is looking at a list of users, they will see a marker if another user has at least one club in common?
[18:48:34] bryanculver: Actually if all users in the chat have at least one club in common
[18:49:12] thebaffoon: has joined #RubyOnRails
[18:49:20] bryanculver: I've done a mock test with recursive programming and it executed in 10 microseconds. This however doesn't short circuit when no match potentials are left
[18:49:36] ravster: So its a query about whether the Chat is in a 'green' or 'red' state?
[18:49:50] ravster: So you really want a boolean response
[18:50:13] bryanculver: And I'd rather not do a lot of bookeeping about the status
[18:50:34] bryanculver: (example User A in clubs [1,2,3] User B in clubs [4,5,6] User C in clubs [2,4])
[18:50:48] bryanculver: Said chat would NOT be club exclusive
[18:51:34] bryanculver: If user B were to join club 2, then it would become club exclusive
[18:51:41] ravster: But if the clubs were [1, 2, 3], [2, 4, 6], and [3,5,2], then it should pass?
[18:52:44] bryanculver: My current recursive algorithm doesn't short circuit, of which I could switch to (example the first arrangement would not check user C since already we know it's not exclusive)
[18:53:14] ravster: I'm thinking something like 2 queries. The first query would search the users, sorted by the number of clubs they belong to (ascending order), and pick the first user. So you have the least number of club_ids to check.
[18:53:22] bryanculver: My overarching question was whether or not I was reinventing the wheel of any pre-exisitng ActiveRecord helper
[18:53:28] patarr: has joined #RubyOnRails
[18:53:43] ravster: I can't recall anything in AR that does this already.
[18:54:28] sandstrom: has joined #RubyOnRails
[18:54:48] bryanculver: And yes, it will require 1+(N Clubs) queries worst case.
[18:55:36] ravster: The second query would look at all users in the Chat where they have a club_id for each club_id in the list, and see if any of the queries has a count equal to the number of users in the Chat.
[18:55:52] ravster: bryanculver: exactly, n+1
[18:56:05] bryanculver: Yeah, that's the effective approach I am taking
[18:56:08] ravster: Which is why you look for the user with the least number of club memberships
[18:56:56] ravster: I'm pretty sure that all that can be brought down into a single SQL query, though.
[18:57:07] ravster: Depending on how strong your sql-fu is.
[18:58:09] bryanculver: I've done stuff like that before but I get a bit... ill-stomached about custom queries. More points of debugging / security issue IMHO
[18:58:25] ravster: And how much of a value-add it is to the business to really optimize it.
[18:58:46] bryanculver: However if the SQL query is 1000X more performant, then I would change my mind.
[18:59:22] bryanculver: I can't see any chat with more than 10 members at any time and no more than 3 active club memberships at a time per person
[18:59:33] ravster: I think it really boils down to what you think the smallest club-membership-count would be for each Chat
[18:59:42] ravster: oh, pfft, nvm.
[19:00:15] ravster: The SQL uber-query would be very cool, but I doubt that people need to figure things out that quickly
[19:00:50] ravster: Still, it would be a really cool read if you put it up on a blog somewhere.
[19:01:11] bryanculver: Yeah, I've had to do similar with networking equipment and available VLANS across 20+ network devices.
[19:02:54] bryanculver: Hmmm... I probably could put a grab bag together for a post. Gotta dust off the ol' pencil for that lol
[19:02:56] ravster: well, nice given that I'm not doing it
[19:10:23] Eindoofus: has joined #RubyOnRails
[19:11:56] Eindoofus: do methods such as belongs_to, has_many, etc. do anything other than provide info about the class when working with a mongo database?
[19:12:16] Eindoofus: sorry, guess i shouldn't be calling those methods?
[19:14:28] v|sh: has joined #RubyOnRails
[19:19:53] User458764: has joined #RubyOnRails
[19:20:34] User458764: has joined #RubyOnRails
[19:31:51] dionysus69: has joined #RubyOnRails
[19:36:44] amperry: has joined #RubyOnRails
[19:40:31] amperry: has joined #RubyOnRails
[19:56:04] cagomez: has joined #RubyOnRails
[19:56:20] defsdoor: eindoofus, they add a load of association methods
[19:56:53] Eindoofus: those association methods work with mongo as well?
[19:57:08] Eindoofus: seems like more of a relational database sort of thing
[20:00:31] patarr: has joined #RubyOnRails
[20:00:49] mikecmpbll: has joined #RubyOnRails
[20:05:47] netzfisch: has joined #RubyOnRails
[20:14:01] daveomcd: when I do "bundle update gem_name" on my development machine... when I run capistrano how does production know to update only that gem for itself? Is it because of the gem lock file recording the version number?
[20:14:16] Pumukel: has joined #RubyOnRails
[20:19:45] FastJack: has joined #RubyOnRails
[20:27:14] patarr: has joined #RubyOnRails
[20:29:51] cseder: has joined #RubyOnRails
[20:31:26] cseder: has joined #RubyOnRails
[20:33:45] SteenJobs: has joined #RubyOnRails
[20:35:51] mjora7: has joined #RubyOnRails
[20:38:11] username1: has joined #RubyOnRails
[20:38:20] amperry: hey folks, I've got a utility ruby script that tries to connect to my database with the same auth tokens as rails, but I'm getting an error: 'FATAL: password authentication failed for user "rayles" (PG::ConnectionBad)'. I can also get into the psql client using those same credentials. Anyone run into a similar problem before?
[20:39:45] mlt-: amperry: Could it be UNIX socket vs TCP issue?
[20:40:01] mlt-: though.. password auth...
[20:40:36] [Butch]: has joined #RubyOnRails
[20:42:29] amperry: mlt-: tried that; was getting a different error before, then put "host: 'localhost'" in the script
[20:44:17] mlt-: amperry: any chance this user has ~/.pgpass or whatever DB you are using with another password? I'm not sure about precedence though.
[20:45:05] amperry: mlt-: turns out the default password was overriding the one I wanted to use; I fixed it :P
[20:45:20] gambl0re: has joined #RubyOnRails
[20:53:10] pupsicle: has joined #RubyOnRails
[20:53:36] mlt-: amperry: you mean like in ./config/database.yml ? :-)
[20:54:02] mlt-: as long as it works now )
[20:54:50] mlt-: So it looks like I can't use #update_all AR method with nested attributes:( Kind of expected though...
[20:55:01] amperry: no, somewhere else. I'm running a set of utility scripts to import data from a completely different data source. The pain is hard to describe :S
[21:11:00] quirkycoders: has joined #RubyOnRails
[21:11:34] cagomez: has joined #RubyOnRails
[21:16:32] planigan: has joined #RubyOnRails
[21:17:30] goldleader: has joined #RubyOnRails
[21:18:42] quirkycoders: has joined #RubyOnRails
[21:20:33] gusrub: has joined #RubyOnRails
[21:29:10] Pumukel: has joined #RubyOnRails
[21:29:31] mlt-: Do I have to supply id value for a nested attribute while updating? I'm getting DB constraint violation as apparently AR doesn't figure out what I want... I thought it would just take it from parent, but from what I see it takes that from parent to look up only, and then tries to set null
[21:29:56] Pumukel: has joined #RubyOnRails
[21:30:45] Pumukel: has joined #RubyOnRails
[21:31:41] Pumukel: has joined #RubyOnRails
[21:32:13] mlt-: Shall I use hidden field on a form? Sounds ugly... not quite my case, but I feel like it will work http://stackoverflow.com/q/9944065/673826
[21:32:21] Pumukel: has joined #RubyOnRails
[21:34:08] srinidhi: has joined #RubyOnRails
[21:34:56] kristofferR: has joined #RubyOnRails
[21:36:03] mlt-: Answers like this http://stackoverflow.com/a/18985990/673826 suggest that id for nested stuff is expected in params
[21:36:46] mlt-: I use f.simple_fields_for and it doesn't look like it places id for nested stuff :(
[21:37:07] NeoMalachi: has joined #RubyOnRails
[21:42:05] lxsameer: has joined #RubyOnRails
[21:43:18] mlt-: ACTION got to go, will figure out later
[21:48:06] linetrace: stack level too deep errors with mutually associated models, each having validates_associated
[21:49:00] linetrace: what's best practice on validates_associated to prevent recursive validations? on the has_one or the has_many or just pick?
[21:49:43] linetrace: (in my case, one has to exist before the other, so maybe only validates_associated on the one that has to be created second (since the prior had to be valid to save)?
[21:51:37] patarr: has joined #RubyOnRails
[21:55:53] mostlybadfly: has joined #RubyOnRails
[21:58:12] linetrace: looks like validates_associated may not work for has_one associations anyway?
[22:00:52] xibalba: has joined #RubyOnRails
[22:08:59] Slogger: Is there an accepted best practice for stripping wrapping whitespace of model attributes? Or is it mostly just do whatever?
[22:09:11] bronson: has joined #RubyOnRails
[22:10:14] antib: has joined #RubyOnRails
[22:27:54] mjora7: has joined #RubyOnRails
[22:29:47] gusrub: has joined #RubyOnRails
[22:31:55] Radar: GOOD MORNING
[22:32:21] Radar: Slogger: Could you explain why you'd want to strip the whitespace?
[22:32:28] Radar: What value is the field storing?
[22:32:37] Radar: linetrace: !rule3
[22:32:37] helpa: linetrace: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[22:35:42] codezomb: has joined #RubyOnRails
[22:36:43] Slogger: Things like user names, would prefer not to have things like "bob " and "bob" happen. I'm not actually having a problem, this is more so there seem to be many ways of accomplishing it, so I was mostly curious if the community has a typical methodology since there seems to be everything from multiple gems to simple before_save and before_validation calls.
[22:42:48] Slogger: (I'm also a little curious because in several JS projects/libs/frameworks I've used similar things seem to be done on assignment/on set, as opposed to on save.)
[23:01:16] spicerack: has joined #RubyOnRails
[23:07:06] wethu: has joined #RubyOnRails
[23:07:21] Radar: ACTION Slogger: Right. I think stripping them before safe is fine.
[23:07:24] Radar: before save*
[23:10:25] romeoh: has joined #RubyOnRails
[23:14:27] gaucheph: has joined #RubyOnRails
[23:19:23] carlosd: has joined #RubyOnRails
[23:21:44] carlosd: In a view file, when I call something like = render 'my_partial', some_var: 'some_value' do link_to 'some_link', some_path end
[23:21:49] carlosd: What method I'm calling?
[23:22:32] carlosd: Is it render(context, options, block) from ActionView::PartialRenderer?
[23:25:34] Technodrome: has joined #RubyOnRails
[23:27:15] lxsameer: has joined #RubyOnRails
[23:28:33] romeoh: Smarter way to write this out ? http://rubyfiddle.com/riddles/8adc0
[23:29:20] carlosd: Yes, it's :D
[23:29:48] carlosd: Best way to discover? Just open the code and raise an exception :P
[23:36:17] romeoh: has joined #RubyOnRails
[23:37:05] Jayson_Virissimo: has joined #RubyOnRails
[23:42:26] DLSteve: has joined #RubyOnRails
[23:45:31] quirkycoders: has joined #RubyOnRails
[23:48:33] duderono_: has joined #RubyOnRails
[23:53:36] romeoh: has joined #RubyOnRails