« Back to channel list

#RubyOnRails - 22 May 2017

« Back 1 day Forward 1 day »
[00:16:24] bheesham: has joined #RubyOnRails
[00:17:50] Rodya_: has joined #RubyOnRails
[00:18:50] quirkycoders: has joined #RubyOnRails
[00:19:07] urkle: has joined #RubyOnRails
[00:19:08] akshat: has joined #RubyOnRails
[00:25:19] bronson: has joined #RubyOnRails
[00:34:36] quirkycoders: has joined #RubyOnRails
[00:35:16] quirkycoders: has joined #RubyOnRails
[00:42:30] waseem_: has joined #RubyOnRails
[00:51:01] quirkycoders: has joined #RubyOnRails
[00:51:18] amperry: has joined #RubyOnRails
[00:51:38] quirkycoders: has joined #RubyOnRails
[01:06:04] waseem_: has joined #RubyOnRails
[01:22:34] sevenseacat: has joined #RubyOnRails
[01:26:12] muhlisbc: has joined #RubyOnRails
[01:28:13] linetrace: has joined #RubyOnRails
[01:35:19] linetrace: what's the proper way to sanitize input in an active record #select call?
[01:38:33] linetrace: the following doesn't work like it does for #where calls, for example: SomeModel.select("*, MATCH(`name`) AGAINST(:input) as score", input: some_string)
[01:41:54] amperry: has joined #RubyOnRails
[01:44:59] amperry: hey folks, I'm trying to find a menu builder gem for a side navigation bar; I tried using 'simple-navigation', but to get it to work as a sidebar with pull-out submenus, I found myself having to write a lot of error-prone css and js. Anyone know of a (bootstrap-compatible) gem?
[01:57:22] apparition: has joined #RubyOnRails
[02:05:43] p8m: has joined #RubyOnRails
[02:06:59] bronson: has joined #RubyOnRails
[02:15:53] Jameser: has joined #RubyOnRails
[02:24:44] daydream: has joined #RubyOnRails
[02:25:51] muhlisbc: has left #RubyOnRails: ()
[02:47:46] irishfromua: has joined #RubyOnRails
[02:52:26] rdavila: has joined #RubyOnRails
[02:53:28] Technodrome: has joined #RubyOnRails
[02:53:38] amperry: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[02:56:19] jphase: has joined #RubyOnRails
[03:03:30] hndk: has joined #RubyOnRails
[03:05:02] Paradox: has joined #RubyOnRails
[03:06:10] Puppet`: has joined #RubyOnRails
[03:10:07] hahuang65: has joined #RubyOnRails
[03:37:09] bronson: has joined #RubyOnRails
[03:46:16] Technodrome: has joined #RubyOnRails
[04:06:03] ur5us: has joined #RubyOnRails
[04:06:36] Paradox: has joined #RubyOnRails
[04:10:50] hahuang65: has joined #RubyOnRails
[04:15:37] jane_booty_doe: has joined #RubyOnRails
[04:30:16] nebiros: has joined #RubyOnRails
[04:41:10] tamouse__: has joined #RubyOnRails
[04:41:30] baweaver: pontiki returns!
[04:41:46] tamouse__: how goes, lemur?
[04:41:57] baweaver: PM me on that one
[04:51:20] quirkycoders: has joined #RubyOnRails
[05:01:50] apparition: has joined #RubyOnRails
[05:02:55] tamouse__: has joined #RubyOnRails
[05:03:41] b0mbnet: has joined #RubyOnRails
[05:07:55] xall: has joined #RubyOnRails
[05:11:32] hahuang65: has joined #RubyOnRails
[05:12:59] wethu: has joined #RubyOnRails
[05:37:13] kitsuneyo: has joined #RubyOnRails
[05:38:08] bronson: has joined #RubyOnRails
[05:48:57] irishfromua: has joined #RubyOnRails
[06:12:17] hahuang65: has joined #RubyOnRails
[06:18:46] DrYockel: has joined #RubyOnRails
[06:20:34] amperry: has joined #RubyOnRails
[06:21:47] amperry: anyone know where to begin troubleshooting why styles aren't applying to a view?
[06:22:35] desnudopenguino: is the css file loading for the view?
[06:23:58] amperry: it certainly doesn't seem to be
[06:24:22] sevenseacat: well are you loading it in the view?
[06:24:26] amperry: I mean, I'll put a change in application.css and nothing changes when I refresh
[06:24:43] sevenseacat: is your page loading application.css ?
[06:25:31] amperry: not deliberately, no
[06:26:04] sevenseacat: if your page isn't loading that css file, then changing that css file will have zero effect on the styling of the page.
[06:26:13] amperry: I was under the impression that application.css was loaded regardless
[06:26:21] sevenseacat: only if your page loads it.
[06:30:03] amperry: if one were to want to load application.css for every page, where would one put the call?
[06:30:13] sevenseacat: in the application layout.
[06:30:19] sevenseacat: or whatever your main layout file is.
[06:31:45] amperry: ah, sonofa... I see it in my previous project, just dinna remember I had a 'stylesheet_link_tag' there.
[06:33:21] amperry: I need to start more projects
[06:46:29] conta: has joined #RubyOnRails
[06:48:48] xall: has joined #RubyOnRails
[06:49:58] conta: has joined #RubyOnRails
[06:54:42] DoubleMalt: has joined #RubyOnRails
[06:54:57] dionysus69: has joined #RubyOnRails
[06:59:44] dionysus69: has joined #RubyOnRails
[07:11:08] amperry: ah well, I'm in incompatible gem versions hell now, which is one rung up from where I was before. Night, all.
[07:11:33] sevenseacat: that'll be fun.
[07:13:19] hahuang65: has joined #RubyOnRails
[07:13:36] quazimodo: has joined #RubyOnRails
[07:13:58] kitsuneyo: has joined #RubyOnRails
[07:17:54] FastJack: has joined #RubyOnRails
[07:24:13] waseem_: has joined #RubyOnRails
[07:27:42] kitsuneyo: has joined #RubyOnRails
[07:39:18] bronson: has joined #RubyOnRails
[07:42:01] zacts: has joined #RubyOnRails
[07:46:09] marr: has joined #RubyOnRails
[07:50:18] blackmesa: has joined #RubyOnRails
[07:52:33] User458764: has joined #RubyOnRails
[08:04:08] mahloun: has joined #RubyOnRails
[08:04:53] wethu: has joined #RubyOnRails
[08:14:03] hahuang65: has joined #RubyOnRails
[08:17:27] mdw: has joined #RubyOnRails
[08:17:39] arBmind: has joined #RubyOnRails
[08:19:25] waseem_: has joined #RubyOnRails
[08:19:54] Silox|: has joined #RubyOnRails
[08:21:19] ur5us: has joined #RubyOnRails
[08:54:46] mrbubbles: Morning folks. If I'm calling a class method on a model from a view, is there a way to access the sender details?
[08:55:34] mrbubbles: I have a model called PageContent which stored content based on url and block id, I wanted to call PageContent.load('block') but not explicitally have to send the page URL
[08:56:52] lxsameer: has joined #RubyOnRails
[08:56:53] universa1: mrbubbles: your model does not know and does not care about the current request... it might very well be called from the console without a request at all
[08:57:07] universa1: mrbubbles: so pass the information you require as a parameter.
[09:02:10] kitsuneyo: has joined #RubyOnRails
[09:03:39] futilegames: has joined #RubyOnRails
[09:09:37] shotbug: has joined #RubyOnRails
[09:10:16] mrbubbles: universa1 okay will do
[09:10:31] mrbubbles: thanks. just thoght it looked a bit messy always passing the current request along with it, but I guess you're right
[09:12:42] universa1: mrbubbles: not sure what you are doing, but passing the full request to a model sounds wrongish ;)
[09:13:15] deur-: sounds like you are trying to have models output view stuff
[09:14:01] deur-: consider using a helper for that, you have the request instance at the ready there
[09:14:42] wethu: has joined #RubyOnRails
[09:14:51] hahuang65: has joined #RubyOnRails
[09:20:26] elsurudo: has joined #RubyOnRails
[09:21:16] elsurudo: What is the best-practice to extend (do something else and then call `super`) on a rails module method? Specifically `ActionView::Helpers::UrlHelper`, in this case
[09:23:56] mrbubbles: Ah yes that makes sense I can call a helper in my view, which will then access the model (and the helper will have access to the request)
[09:24:00] mrbubbles: Thanks guys :)
[09:26:41] mrbubbles: Beauty yep that worked
[09:27:27] mrbubbles: Ah it's so handy just having people around to bounce things off. Sometimes it's so easy to get hung up when you *think* you have an idea, but actually the correct solution is so much cleaner
[09:34:34] quazimodo: has joined #RubyOnRails
[09:34:39] shotbug: has joined #RubyOnRails
[09:40:21] bronson: has joined #RubyOnRails
[09:46:37] konsolebox: has joined #RubyOnRails
[09:51:53] bheesham: has joined #RubyOnRails
[09:52:31] arBmind: has joined #RubyOnRails
[09:59:13] dionysus70: has joined #RubyOnRails
[10:02:22] mtkd: has joined #RubyOnRails
[10:08:22] mrbubbles: is there a wysiwyg editor that isn't rubbish nowadays? just had a look at trix but it doesn't use P tags properly
[10:10:41] xall: has joined #RubyOnRails
[10:13:04] v|sh: has joined #RubyOnRails
[10:15:39] hahuang65: has joined #RubyOnRails
[10:19:51] elsurudo: What is the best-practice to extend (do something else and then call `super`) on a rails module method? Specifically `ActionView::Helpers::UrlHelper`, in this case
[10:20:24] universa1: elsurudo: what are you actually trying to do?
[10:21:47] elsurudo: @universa1 The `current_page?` method doesn’t take into account the locale in `default_url_params`, so I would like to extend it to do so. See: https://github.com/rails/rails/issues/28253
[10:22:31] elsurudo: Basically it returns false when it should return true, if there is no locale set in the URL params, in my case
[10:23:13] universa1: elsurudo: application_helper.rb; def current_page?; do_your_work; super ...; end ?
[10:28:06] elsurudo: @universa1 Just tried it – for some reason I get “wrong number of arguments (given 2, expected 1)” when I call `super`, even though I am exactly matching the method signature when I call super
[10:29:17] elsurudo: The reason I didn’t try this before: how would `super` know what module’s `super` to call?
[10:29:24] elsurudo: I am a bit skeptical of it
[10:32:19] waseem_: has joined #RubyOnRails
[10:41:47] waseem_: has joined #RubyOnRails
[10:51:40] shotbug: has joined #RubyOnRails
[10:56:42] soahccc: has joined #RubyOnRails
[10:59:36] quazimodo: has joined #RubyOnRails
[11:07:42] srinidhi: has joined #RubyOnRails
[11:11:05] renegadeandy: has joined #RubyOnRails
[11:16:23] hahuang65: has joined #RubyOnRails
[11:17:01] alexfu: has joined #RubyOnRails
[11:21:09] qguv: has joined #RubyOnRails
[11:25:43] Jameser: has joined #RubyOnRails
[11:29:06] DrYockel: has joined #RubyOnRails
[11:32:52] arBmind: has joined #RubyOnRails
[11:34:35] FastJack: has joined #RubyOnRails
[11:41:15] HoierM: has joined #RubyOnRails
[11:41:35] User458764: has joined #RubyOnRails
[11:41:59] bronson: has joined #RubyOnRails
[11:44:05] workmad3: elsurudo: 'super' just calls the next item in the method lookup chain... it's fully deterministic, because the method lookup chain is deterministic
[11:45:04] workmad3: elsurudo: if you're curious about the order of that lookup, you can use `SomeClass.ancestors` to see the ancestor chain, which is the order that classes and modules are checked for a matching method (before restarting and going through 'method_missing' up the chain instead)
[11:47:35] sonOfRa: has joined #RubyOnRails
[11:50:28] catbusters: has joined #RubyOnRails
[11:52:16] bheesham: has joined #RubyOnRails
[11:53:57] shotbug: has joined #RubyOnRails
[12:00:47] Jameser: has joined #RubyOnRails
[12:02:00] blackmesa: has joined #RubyOnRails
[12:06:08] Ergo: has joined #RubyOnRails
[12:07:32] hashrocket: has joined #RubyOnRails
[12:07:48] elsurudo: @workmad3 thanks, that is useful to know. Guess I need to read up on ruby internals some more
[12:08:22] elsurudo: But how would this work in the case of view helpers, as in my example? It doesn’t seem like a hierarchy, really
[12:09:02] workmad3: elsurudo: it's always a hierarchy... it's just more hidden
[12:09:32] elsurudo: Right, makes sense. Implicit
[12:12:44] Technodrome: has joined #RubyOnRails
[12:13:14] matthewd: elsurudo: `self.singleton_class.ancestors` will show you the full order, for whatever context you call it in
[12:15:31] elsurudo: @matthewd thanks
[12:16:43] Ergo: has joined #RubyOnRails
[12:17:08] hahuang65: has joined #RubyOnRails
[12:22:17] Jameser: has joined #RubyOnRails
[12:39:17] ResidentBiscuit: has joined #RubyOnRails
[12:39:30] Ergo: has joined #RubyOnRails
[12:41:48] quirkycoders: has joined #RubyOnRails
[12:45:37] ResidentBiscuit: has joined #RubyOnRails
[12:46:00] zepy_aq: has joined #RubyOnRails
[12:46:57] ResidentBiscuit: has joined #RubyOnRails
[12:50:41] xall: has joined #RubyOnRails
[13:01:07] shotbug: has joined #RubyOnRails
[13:06:04] uksio: has joined #RubyOnRails
[13:09:37] tercenya: has joined #RubyOnRails
[13:11:43] tercenya: has joined #RubyOnRails
[13:13:45] tercenya: has joined #RubyOnRails
[13:14:07] uks: has joined #RubyOnRails
[13:14:34] xx00__: has joined #RubyOnRails
[13:18:44] hahuang65: has joined #RubyOnRails
[13:22:27] uks: has joined #RubyOnRails
[13:27:22] DLSteve: has joined #RubyOnRails
[13:28:17] noob_on_rails: has joined #RubyOnRails
[13:28:27] SteenJobs: has joined #RubyOnRails
[13:28:37] Jameser: has joined #RubyOnRails
[13:29:15] noob_on_rails: hey everyone :) , i want to connect to a remote site that has elastic runninc , i have all the passwords etc, where can i read how this is accomplished?
[13:30:23] patarr: has joined #RubyOnRails
[13:30:34] universa1: noob_on_rails: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html maybe this?
[13:31:12] qguv: has joined #RubyOnRails
[13:35:14] noob_on_rails: universa1: hmm , i don't understand it completely , but what i want to do is just take some elastic data and present them to my site , i started messing with active_resource
[13:35:31] noob_on_rails: so when the application starts and gets the '/' route i can fetch the data from there
[13:36:43] Jameser: has joined #RubyOnRails
[13:39:10] pupsicle: noob_on_rails: have you taken a look at this ruby gem https://github.com/elastic/elasticsearch-rails
[13:40:07] noob_on_rails: hmm yes of course but i didn't think it can connect to a remote one
[13:40:12] noob_on_rails: that's a good idea ill look it up
[13:42:53] bronson: has joined #RubyOnRails
[13:43:51] pupsicle: noob_on_rails: It's using elasticsearch-transport under the covers which lists how to connect to another host in its docs: http://www.rubydoc.info/gems/elasticsearch-transport
[13:46:46] linetrace: what's the proper way to sanitize sql for a select call (it doesn't seem to support parameterization, like where)?
[13:48:10] noob_on_rails: pupsicle: thanks im currently reading :)
[13:48:30] pupsicle: linetrace: I do ActiveRecord::Base.send(:sanitize_sql_array, query, [params])
[13:49:14] pupsicle: linetrace: https://apidock.com/rails/ActiveRecord/Base/sanitize_sql_array/class
[13:49:43] linetrace: pupsicle: thanks, I was looking at ActiveRecord::Sanitization.sanitize_sql_for_conditions
[13:50:58] quirkycoders: has joined #RubyOnRails
[13:51:48] pupsicle: sorry linetrace, I meant ActiveRecord::Base.send(:sanitize_sql_array, [query, params...])
[13:52:28] bheesham: has joined #RubyOnRails
[13:53:02] linetrace: pupsicle: no worries, thanks
[13:56:35] linetrace: pupsicle: it looks like you can't parameterize with ?, but %s instead, correct?
[14:02:14] tbuehlmann: ? should work, see http://api.rubyonrails.org/classes/ActiveRecord/Sanitization/ClassMethods.html#method-i-sanitize_sql_array
[14:03:51] linetrace: tbuehlmann: perfect, thanks!
[14:06:53] kristofferR: has joined #RubyOnRails
[14:11:27] FastJack: has joined #RubyOnRails
[14:13:04] quirkycoders: has joined #RubyOnRails
[14:16:13] qguv: has joined #RubyOnRails
[14:16:50] User458764: has joined #RubyOnRails
[14:19:28] hahuang65: has joined #RubyOnRails
[14:19:55] quirkycoders: has joined #RubyOnRails
[14:20:15] theunraveler: has joined #RubyOnRails
[14:21:43] qguv: has joined #RubyOnRails
[14:24:40] xall: has joined #RubyOnRails
[14:25:26] quirkycoders: has joined #RubyOnRails
[14:35:00] centrx: has joined #RubyOnRails
[14:35:06] patarr: has joined #RubyOnRails
[14:38:06] rdavila: has joined #RubyOnRails
[14:38:58] banisterfiend: has joined #RubyOnRails
[14:41:33] AzaToth: has joined #RubyOnRails
[14:43:15] drale2k_: has joined #RubyOnRails
[14:43:55] noob_on_rails: has joined #RubyOnRails
[14:44:57] chouhoulis: has joined #RubyOnRails
[15:00:25] patarr1: has joined #RubyOnRails
[15:05:51] SteenJobs: has joined #RubyOnRails
[15:13:33] irishfromua: has joined #RubyOnRails
[15:14:52] xx00__: has joined #RubyOnRails
[15:18:08] irishfromua: has joined #RubyOnRails
[15:20:12] hahuang65: has joined #RubyOnRails
[15:21:35] hobodave: has joined #RubyOnRails
[15:25:21] ResidentBiscuit: has joined #RubyOnRails
[15:25:45] ResidentBiscuit: has joined #RubyOnRails
[15:28:21] ascarter: has joined #RubyOnRails
[15:29:04] cnk: has joined #RubyOnRails
[15:29:43] ahrs: has joined #RubyOnRails
[15:33:53] brahman: has joined #RubyOnRails
[15:34:50] brahman: Hi, I am setting up a rails 5 json api and need to have some form of token authentication. IIRC Devise used to do this but cant seem to find any relevant information. Can anyone point me to docs/best practices ?
[15:37:34] mikecmpbll: has joined #RubyOnRails
[15:39:44] xx00__: has joined #RubyOnRails
[15:41:06] SteenJobs: has joined #RubyOnRails
[15:42:15] ResidentBiscuit: has joined #RubyOnRails
[15:42:34] blackmesa: has joined #RubyOnRails
[15:43:54] bronson: has joined #RubyOnRails
[15:47:13] mrgreenfur: has joined #RubyOnRails
[15:50:57] LightStalker: has joined #RubyOnRails
[15:51:13] rafaeldelucena: has joined #RubyOnRails
[15:51:44] [Butch]: has joined #RubyOnRails
[15:52:45] bheesham: has joined #RubyOnRails
[15:54:43] polishdub: has joined #RubyOnRails
[15:54:49] mrgreenfur: Random redis question: AppSignal tells me during a new account signup flow, that i’m allocated 2.4mm ruby objects across 54,000 redis calls. This seems very bad and slow. Int he code, i cache a single rails model to redis. Anyone know where to look to find all these others?
[16:02:39] xx00__: has joined #RubyOnRails
[16:06:22] rakm: has joined #RubyOnRails
[16:13:07] banisterfiend: has joined #RubyOnRails
[16:18:29] matthewd: mrgreenfur: Redis can show you all the commands being run
[16:19:39] armyriad: has joined #RubyOnRails
[16:20:02] mrgreenfur: @matthewd Monitor command?
[16:20:19] matthewd: Yeah, that's the one
[16:20:26] mrgreenfur: will give it a shot, thanks for the tip!
[16:21:00] hahuang65: has joined #RubyOnRails
[16:24:41] hobodave: has joined #RubyOnRails
[16:26:14] blackmesa: has joined #RubyOnRails
[16:28:02] mrgreenfur: holy crap, a few big objects are written and then thousands of scans
[16:28:05] mrgreenfur: thanks matthewd
[16:28:45] Technodrome: has joined #RubyOnRails
[16:29:06] drale2k_: has joined #RubyOnRails
[16:31:50] patarr: has joined #RubyOnRails
[16:36:39] mrgreenfur: Man, redis-cache is following endless empty cursors from redis, even when there are no results
[16:37:41] Uranio: has joined #RubyOnRails
[16:37:46] noob_on_rails: has joined #RubyOnRails
[16:37:50] Uranio: has left #RubyOnRails: ()
[16:40:14] rgr_: has joined #RubyOnRails
[16:40:14] quirkycoders: has joined #RubyOnRails
[16:41:33] centrx: has joined #RubyOnRails
[16:48:00] mrgreenfur: turns out it’s how redis works. Using deletE_matched will always iterate through ALL keys , just with a cursor
[16:48:28] mrgreenfur: anyone have tips for better namespaceing redis keys? E.g. I’m caching computed values for an account and saving them with the account ID in the key name, then using delete_matched periodically to erase them all
[16:50:01] DarkBushido: has joined #RubyOnRails
[16:51:03] workmad3: mrgreenfur: can't you do something like store a 'accounts.<account_id>' key and then issue a `delete("accounts.*")` command?
[16:51:14] mrgreenfur: thats basically what i’m doing
[16:51:16] Cesariox: has joined #RubyOnRails
[16:51:29] mrgreenfur: but when you do a delete with a wildcard, it scans every key using a cursor to find matching ones
[16:51:53] mrgreenfur: so each operation is O(1) but it’s really O(n) as it follows the cursors
[16:51:55] hahuang65: has joined #RubyOnRails
[16:52:15] mrgreenfur: I’d love it if there was a way to nest keys under another
[16:52:22] workmad3: hmm... how about storing accounts into a hash?
[16:52:37] workmad3: key it by account ID
[16:52:37] mrgreenfur: I have those, they’re in the db
[16:52:46] workmad3: no, store them in redis as a hash
[16:52:55] mrgreenfur: and then deleting the whole hash
[16:53:19] workmad3: hset "accounts" <account_id> <data>
[16:53:47] mrgreenfur: mind exploded
[16:53:47] workmad3: and then delete with just a plain `delete("accounts")`
[16:54:31] mrgreenfur: i love it, i wonder how to make rails.cache.fetch work with this, maybe i’ll monkey patch it in
[16:55:22] workmad3: mrgreenfur: tbh, if you're really treating it as a cache, I'd be tempted to just set sensible expirations on it
[16:55:48] workmad3: the rails cache interface probably won't work well with using a hash under the hood, as you can't expire individual keys
[16:56:05] workmad3: (at least, not in a way that's natively supported by the backend)
[16:56:07] banisterfiend: has joined #RubyOnRails
[16:56:08] mrgreenfur: yeah, that works for some computed values. I also have some infrequently changing settings that i read a lot but don’t write frequently. When they change I need to erase them all.
[16:56:48] mrgreenfur: they are mostly in async workers so no one hears redis scream in pain
[16:56:49] workmad3: if you're dealing with infrequently changing settings, I'd suggest not accessing that through the cache interface, so you have this control :)
[16:56:58] mrgreenfur: very goo dpoint
[16:57:06] workmad3: I like using https://github.com/sorentwo/readthis for redis
[16:57:38] workmad3: and then you can access an underlying connection with `Rails.cache.pool.with {|redis| ... }` iirc
[16:58:20] workmad3: (or you can create an extra Readthis interface that isn't set to the Rails cache, and access with readthis.pool.with...)
[16:59:12] workmad3: you also get the niceties of connection pooling built in, which I've not seen with other redis cache adapters :)
[16:59:52] mrgreenfur: oh wow, this is awesome. Using it for regular cache and directly is super
[17:00:05] mrgreenfur: ^ err as cache store and directly
[17:00:11] xx00__: has joined #RubyOnRails
[17:02:50] workmad3: mrgreenfur: just be careful about connection limits if you have them in your redis setup :)
[17:03:43] workmad3: (accidentally ran into that recently... had some extra workers spun up for a large backfill and had upped our hosted redis plan for the duration too... dropped the plan back down but didn't spin the workers down again, so hit our connection limits :( )
[17:04:55] mrgreenfur: will keep it in mind, thanks for the warning :)
[17:05:10] patarr: has joined #RubyOnRails
[17:06:21] gusrub: has joined #RubyOnRails
[17:15:25] defsdoor: has joined #RubyOnRails
[17:21:14] quirkycoders: has joined #RubyOnRails
[17:29:40] patarr: has joined #RubyOnRails
[17:31:55] shilon: has joined #RubyOnRails
[17:32:12] mrgreenfur: @workmad3 do you use a monkeypatch to avoid caching nil values?
[17:34:52] User458764: has joined #RubyOnRails
[17:42:44] patarr: Hey, can anyone here recommend what you've found to be the best Rails & Swagger integration gems?
[17:45:02] bronson: has joined #RubyOnRails
[17:47:26] noob_on_rails: anyone here know hot to connect to remote elastic cluster? im very close but im getting some ssl faults
[17:49:31] ur5us: has joined #RubyOnRails
[17:53:01] bheesham: has joined #RubyOnRails
[17:56:07] lgeurts: has joined #RubyOnRails
[17:57:37] dionysus69: has joined #RubyOnRails
[17:59:11] blackmesa: has joined #RubyOnRails
[17:59:38] Cache_Money: has joined #RubyOnRails
[18:01:41] hobodave_: has joined #RubyOnRails
[18:05:35] quiller: has joined #RubyOnRails
[18:05:45] pLaTo0n: has joined #RubyOnRails
[18:10:27] mtkd: has joined #RubyOnRails
[18:14:54] quirkycoders: has joined #RubyOnRails
[18:15:10] jphase: has joined #RubyOnRails
[18:17:11] centrx: has joined #RubyOnRails
[18:22:25] mlt-: has joined #RubyOnRails
[18:26:50] patarr1: has joined #RubyOnRails
[18:27:11] polishdub: has joined #RubyOnRails
[18:30:41] hobodave_: matthewd you around?
[18:31:59] dminuoso: fryguy: The person was being silly.
[18:42:05] sonOfRa: has joined #RubyOnRails
[18:43:19] bheesham: has joined #RubyOnRails
[18:49:33] Aherin: has joined #RubyOnRails
[18:59:27] Technodrome: has joined #RubyOnRails
[19:00:56] mrgreenfur: has left #RubyOnRails: ()
[19:04:50] centrx: has joined #RubyOnRails
[19:07:58] gusrub: hello there, is there a way to pull defined scopes in an AR model? (don't want to use respond_to?)
[19:09:40] eelster: has joined #RubyOnRails
[19:09:54] Ky|o-Ren: has joined #RubyOnRails
[19:09:56] Ky|o-Ren: has left #RubyOnRails: ()
[19:12:01] dminuoso: gusrub: http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope
[19:12:07] dminuoso: gusrub: click on "show source" at the bottom
[19:12:22] dminuoso: gusrub: And then you can judge for yourself.
[19:13:12] dminuoso: gusrub: Your best bet would be to extend ActiveRecord::Base (see, this is why keeping ApplicationRecord is such a great idea) with a new class that wraps :scope and keeps a list
[19:13:20] dminuoso: and by "extend" I mean derive from.
[19:13:37] bheesham: has joined #RubyOnRails
[19:14:47] gusrub: has joined #RubyOnRails
[19:17:08] hobodave: found a bug in ActiveSupport::Concern
[19:17:16] dminuoso: hobodave: Good. Now stop using it.
[19:17:18] eelster: Oh, what's the bug?
[19:17:23] hobodave: I've been tracing this thing for a week
[19:17:35] dminuoso: ActiveSupport::Concern is for people who dont understand Ruby.
[19:18:00] centrx: it removes ceremony whether you understand it or not
[19:18:03] hobodave: Rails uses it extensively
[19:18:05] hobodave: Since I use rails, I use ActiveSupport::Concern
[19:18:13] dminuoso: hobodave: Yeah but for no real good reason.
[19:18:16] hobodave: and Rails' default behavior exposes the bug under concurrency
[19:18:23] dminuoso: hobodave: You might as well just use raw modules and include/extend/prepend
[19:18:26] hobodave: Thanks dminuoso
[19:18:27] centrx: also orders dependencies
[19:18:41] eelster: Wait, but what's the bug?
[19:18:55] dminuoso: centrx: what are you talking about?
[19:19:22] centrx: ActiveSupport::Concern removes a small amount of ceremony from Ruby
[19:19:30] mtkd: has joined #RubyOnRails
[19:19:32] srinidhi: has joined #RubyOnRails
[19:19:42] dminuoso: That's just a repetition of what you said.
[19:19:51] centrx: It's useful. Not related to understanding Ruby or not
[19:20:23] dminuoso: centrx: What particular problem does a raw ruby module with include have?
[19:20:30] dminuoso: (or extend/prepend)
[19:21:12] gusrub: has joined #RubyOnRails
[19:22:01] centrx: Ceremony is boilerplate code, such as the code required to use class methods in an included module
[19:22:07] gusrub: @dminuoso oh, great, I was actually looking at that page but I always forget about the show source thing, thanks a lot
[19:22:31] centrx: Maybe you're advocating splitting modules into two separate files, one included and one extended, but that's another level of complication. Might as well say we should do that for classes.
[19:25:18] brent__: has joined #RubyOnRails
[19:25:27] dminuoso: centrx: Im not sure whether `def self.included(base); base.extend(ClassMethods); end` is so complicated that we need to hide how Ruby works..
[19:26:19] centrx: Ruby hides how C works, that's just abstraction
[19:26:46] dminuoso: centrx: Though I guess the module dependency is a fair point.
[19:26:53] centrx: Concern provides a number of little benefits
[19:27:06] centrx: It's almost worthless, but not
[19:27:22] dminuoso: centrx: I will never use it regardless because I understand how Ruby works internally. *shrugs*
[19:27:50] dminuoso: But that's actually relatively new. I used to use AS::Concern a few years ago
[19:28:03] dminuoso: Until there was just too much "framework magic" happening
[19:28:03] hobodave: I actually think I misspoke. The bug is either in Class#class_attribute or ActiveSupport::Scoping::Default, depending on how you look at it
[19:28:10] dminuoso: hobodave: Whats the bug?
[19:28:57] hobodave: the bug is here: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/class/attribute.rb#L89
[19:29:23] hobodave: when you "assign" a value to an attribute declared by class_attribute, you're deleting and redefining methods at runtime
[19:30:03] hobodave: Do that under concurrent load (JRuby) and threads are calling methods that don't exist momentarily
[19:30:07] hobodave: it's the cause of these: https://github.com/rails/rails/issues/25838 and https://github.com/rails/rails/issues/27418
[19:30:25] dminuoso: hobodave: This appears to be a pure rails bug.
[19:31:07] hobodave: I'm not sure what other inference could be made
[19:32:16] dminuoso: hobodave: https://github.com/rails/rails/issues/14021
[19:33:15] hobodave: that's definitely it
[19:33:34] hobodave: it has nothing to do with Paper trail. I've reproduced it using *just* rails code, no other gems
[19:33:52] dminuoso: hobodave: Yeah, and there's some referenced issues and open PRs in the ticket too.
[19:33:57] dminuoso: All pointing to the same thing.
[19:34:51] dminuoso: hobodave: https://github.com/tonycoco/pusherable/pull/7
[19:34:53] hobodave: I worked around it by eagerly memoizing the value of default_scope_override in the class definition
[19:34:54] dminuoso: hobodave: I wonder what happened to that
[19:36:03] hobodave: If this is truly not thread-safe by design, then the error seems to be in the usage of it within ActiveRecord::Scoping::Default
[19:36:36] hobodave: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/scoping/default.rb#L108
[19:36:38] patarr: has joined #RubyOnRails
[19:37:13] hobodave: Line 108 shown there is not a simple atomic assignment. It uses the voodoo in class_attribute. Then some threads when executing line 111 below will raise NoMethodError
[19:37:48] ascarter: has joined #RubyOnRails
[19:38:03] hobodave: setting self.default_scope_override = false (or true, if applicable) circumvents the bug entirely
[19:38:45] hobodave: doing the method redefinition voodoo is reasonably justifiable if the expectation is that it only happens during boot time
[19:40:08] elsurudo: has joined #RubyOnRails
[19:41:00] elsurudo: ActiveRecord: I want to override a getter for an attribute and derive a higher-level object, but I still want to use the value that rails gives _after_ type casting etc. Is this possible?
[19:42:34] elsurudo: Ah nevermind, I think I can just use `read_attribute`
[19:44:00] elsurudo: Yup, works great
[19:44:28] ^mtkd: has joined #RubyOnRails
[19:46:05] bronson: has joined #RubyOnRails
[19:48:51] jfelchner: has joined #RubyOnRails
[19:49:33] xx00__: has joined #RubyOnRails
[19:52:43] hobodave: matthewd you around?
[20:04:58] hobodave: I fixed it!
[20:05:48] banisterfiend: has joined #RubyOnRails
[20:07:45] noob_on_rails: how can i access the fields of an elastic remote GET response of this type: #<Elasticsearch::Transport::Transport::Response:0x007ffaa0e46608>
[20:11:40] marr: has joined #RubyOnRails
[20:13:10] lxsameer: has joined #RubyOnRails
[20:16:21] Silox|: has joined #RubyOnRails
[20:16:25] hobodave: gahh, I didn't fix it :(
[20:16:29] patarr: has joined #RubyOnRails
[20:23:07] qguv: has joined #RubyOnRails
[20:26:56] shilon: has joined #RubyOnRails
[20:27:41] shilon: has joined #RubyOnRails
[20:28:02] quazimodo: has joined #RubyOnRails
[20:28:41] shilon: has joined #RubyOnRails
[20:29:10] ascarter: has joined #RubyOnRails
[20:29:26] shilon: has joined #RubyOnRails
[20:30:11] shilon: has joined #RubyOnRails
[20:31:01] shilon: has joined #RubyOnRails
[20:31:53] shilon: has joined #RubyOnRails
[20:32:33] shilon: has joined #RubyOnRails
[20:32:40] duderonomy: has joined #RubyOnRails
[20:33:18] shilon: has joined #RubyOnRails
[20:34:10] shilon: has joined #RubyOnRails
[20:35:00] shilon: has joined #RubyOnRails
[20:35:55] shilon: has joined #RubyOnRails
[20:36:43] shilon: has joined #RubyOnRails
[20:37:28] ChanServ: +o baweaver
[20:37:28] shilon: has joined #RubyOnRails
[20:38:07] shilon: has joined #RubyOnRails
[20:38:10] baweaver: Shilon: fix your connection, #ruby-fix-your-connection
[20:38:14] baweaver: +b *!~Shilon@a79-168-104-17.cpe.netcabo.pt
[20:38:15] baweaver: baweaver kicked Shilon: behavior is not conducive to the desired environment.
[20:38:52] ChanServ: -o baweaver
[20:41:32] blackmesa: has joined #RubyOnRails
[20:45:39] rdavila: has joined #RubyOnRails
[20:49:11] drale2k_: has joined #RubyOnRails
[20:52:35] dminuoso: baweaver: You sir need weechat.
[20:52:49] dminuoso: irc_smart_filter is a blessing
[20:53:29] dminuoso: Or madam. I have not determined your gender yet.
[20:54:20] dminuoso: Experience shows that I can't rely on "Brandon" being an indication of your biological gender, legal gender or identity.
[20:55:35] blackmesa: has joined #RubyOnRails
[21:03:19] ur5us: has joined #RubyOnRails
[21:07:06] ChanServ: +o baweaver
[21:07:18] baweaver: -b *!~Shilon@a79-168-104-17.cpe.netcabo.pt
[21:07:33] ChanServ: -o baweaver
[21:08:56] renegadeandy: has joined #RubyOnRails
[21:09:05] blackmesa: has joined #RubyOnRails
[21:30:54] ascarter: has joined #RubyOnRails
[21:37:36] drale2k_: has joined #RubyOnRails
[21:41:40] shilon: has joined #RubyOnRails
[21:42:00] shilon: sorry baweaver
[21:42:09] baweaver: not a big deal
[21:42:14] boxmein: has joined #RubyOnRails
[21:42:37] rakm: hey, just making sure, rails doesn't provide a javascript equivalent to number_with_delimiter, does it?
[21:44:40] dminuoso: rakm: number.to_s.reverse.scan(/\d{1,3}/).join("_").reverse
[21:45:01] dminuoso: rakm: Though AV is here to hold your hand: http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter
[21:45:29] rakm: what's AV?
[21:46:07] rakm: yeah, i know about that function and i can write the regex myself, i was just making sure rails doesn't include any helper functions in js
[21:46:18] dminuoso: ohh wait you want a JS variant
[21:46:24] rakm: although toLocaleString() seems to work fine
[21:46:52] dminuoso: rakm: No it wouldn't because toLocaleString() is standard and exists.
[21:46:58] bronson: has joined #RubyOnRails
[21:47:00] dminuoso: (No it wouldn't exist)
[21:56:13] HoierM: has joined #RubyOnRails
[22:01:16] bronson: has joined #RubyOnRails
[22:24:33] Pumukel: has joined #RubyOnRails
[22:41:00] Radar: GOOD MORNING
[22:49:45] ResidentBiscuit: has joined #RubyOnRails
[22:54:39] francuz: good morning
[23:00:54] hd1: has joined #RubyOnRails
[23:02:11] xx00__: has joined #RubyOnRails
[23:06:21] xx00__: has joined #RubyOnRails
[23:09:43] renegadeandy: has joined #RubyOnRails
[23:14:32] bronson: has joined #RubyOnRails
[23:15:38] HoierM: has joined #RubyOnRails
[23:17:28] dminuoso: Radar: !goodmorning
[23:17:28] helpa: Radar: おはよう ございます
[23:17:34] dminuoso: helpa is being nice today.
[23:17:43] dminuoso: I wonder who wrote them.
[23:18:44] dminuoso: Radar: You too respond to ! commands"?
[23:19:00] dminuoso: Radar: Is there a list of your factoids somewhere?
[23:19:03] helpa: Just the tips: http://logs.ryanbigg.com/tips
[23:19:11] dminuoso: Not helpa, I meant you.
[23:19:14] Radar: My personal factoids?
[23:19:22] Radar: Yeah but you need to pay money to paypal.me/ryanbigg to see them
[23:19:34] dminuoso: Is there a price tag
[23:19:47] ResidentBiscuit: has joined #RubyOnRails
[23:19:58] Radar: Whatever your heart thinks is normal
[23:22:16] dminuoso: Radar: Done.
[23:23:22] Radar: I did not expect that to be your name.
[23:23:43] dminuoso: I still blame my parents.
[23:24:08] Radar: Ok, here's the factoid: you can use "Radar" or "radaR" to get my attention.
[23:24:36] dminuoso: That's interesting.
[23:24:51] dminuoso: I was hoping for something more profound than this.
[23:24:57] dminuoso: But I guess you get what you pay for. ;o
[23:25:59] dminuoso: Radar: Jokes aside, after having my account disabled by paypal security after the gazillionth invalid login attempt from Iran, I decided using an obfuscated paypal address would reduce visibility and the need for another call to paypal
[23:26:56] Radar: There are also rumours that if you have code in your codebase which allocates more than 100mb of RAM during its runtime the Radar will _know)
[23:27:35] kies: has joined #RubyOnRails
[23:27:36] dminuoso: That I will print and stick to the inside of a pizza carton.
[23:32:57] wethu: has joined #RubyOnRails
[23:35:29] gusrub: has joined #RubyOnRails
[23:36:42] wethu: has joined #RubyOnRails
[23:45:59] noob_on_rails: has joined #RubyOnRails
[23:47:21] brent__: has joined #RubyOnRails