« Back to channel list

#RubyOnRails - 25 October 2017

« Back 1 day Forward 1 day »
[00:02:21] Technodrome: has joined #RubyOnRails
[00:06:32] Cork: has joined #RubyOnRails
[00:09:30] hahuang65: has joined #RubyOnRails
[00:09:47] centrx: has joined #RubyOnRails
[00:17:40] PresidentBiscuit: has joined #RubyOnRails
[00:19:58] sevensidedmarble: has joined #RubyOnRails
[00:25:57] dviola: has joined #RubyOnRails
[00:26:25] kapil___: has joined #RubyOnRails
[00:26:38] blindMoe: has joined #RubyOnRails
[00:26:49] blindMoe: What is the proper way to return results for a model only if it has a specific relation set?
[00:27:20] blindMoe: the table I am querying agains has a ton of records so I want to try and do it as efficiently as possible ( a ton = 100,000,000+ )
[00:29:10] blindMoe: Right now I am doing Foo.joins(:bar).group('bar.id') but not sure if there is a better way
[00:31:11] gusrub: has joined #RubyOnRails
[00:37:13] fryguy: blindmoe is `Foo.where('bar_id is not null')` adequate?
[00:37:47] blindMoe: fryguy: nah because bar contains foo_id ( relation goes the other way )
[00:38:12] Cork: has joined #RubyOnRails
[00:39:21] fryguy: ok, and so what relation do you want to return?
[00:39:42] blindMoe: I want to return all records of Foo that have a Bar set
[00:40:04] fryguy: and Bar has a foo_id column?
[00:40:35] fryguy: Foo.where(id: Bar.distinct('foo_id')) ?
[00:41:19] blindMoe: I am sure that would work butI am wondering if it is more efficient
[00:41:35] blindMoe: curious about the response times of the query since it is an api call
[00:42:06] fryguy: break out the profiling tools and have at it
[00:42:35] fmcgeough: has joined #RubyOnRails
[00:55:50] ForeignBiscuit: has joined #RubyOnRails
[00:56:19] ForeignBiscuit: has joined #RubyOnRails
[00:56:44] ForeignBiscuit: has joined #RubyOnRails
[00:56:58] Cork: has joined #RubyOnRails
[00:57:09] ForeignBiscuit: has joined #RubyOnRails
[00:57:34] ForeignBiscuit: has joined #RubyOnRails
[00:58:20] ForeignBiscuit: has joined #RubyOnRails
[00:59:52] veloutin: has joined #RubyOnRails
[01:13:57] jphase: has joined #RubyOnRails
[01:28:05] alfiemax: has joined #RubyOnRails
[01:50:47] Technodrome: has joined #RubyOnRails
[01:50:49] gusrub: has joined #RubyOnRails
[01:54:23] Jameser: has joined #RubyOnRails
[01:57:22] orbyt_: has joined #RubyOnRails
[02:00:33] blackcross: fryguy: I would think Bar.distinct('foo_id') would only show the first matching Bar with foo_id, and not all Bars with foo_id
[02:01:21] blackcross: as in, if Foo.id == 1, then only the first Bar with foo_id==1 would show and not a 2nd Bar with foo_id==1
[02:02:49] blackcross: ohh, nvm, I see what you want, all Foo, not all Bars
[02:09:23] fryguy: blackcross: you said you wanted foos, not bars
[02:10:17] hahuang65: has joined #RubyOnRails
[02:10:25] DTZUZO: has joined #RubyOnRails
[02:18:28] jphase: has joined #RubyOnRails
[02:24:27] Technodrome: has joined #RubyOnRails
[02:28:20] irishfromua: has joined #RubyOnRails
[02:36:23] chouhoulis: has joined #RubyOnRails
[02:39:54] srinidhi: has joined #RubyOnRails
[02:44:03] Borderliner: has joined #RubyOnRails
[02:45:31] lacour: has joined #RubyOnRails
[02:55:38] ephemer0l_: has joined #RubyOnRails
[03:02:56] mikecmpbll: has joined #RubyOnRails
[03:03:12] jphase: has joined #RubyOnRails
[03:05:29] jphase_: has joined #RubyOnRails
[03:06:30] jphase__: has joined #RubyOnRails
[03:08:58] jphase: has joined #RubyOnRails
[03:11:05] hahuang65: has joined #RubyOnRails
[03:20:27] lethjakman: has joined #RubyOnRails
[03:27:10] hahuang65: has joined #RubyOnRails
[03:30:57] alfiemax: has joined #RubyOnRails
[03:33:05] quazimodo: has joined #RubyOnRails
[03:41:23] guacamole: has joined #RubyOnRails
[03:52:15] gr33nw00d: has joined #RubyOnRails
[03:53:08] gr33nw00d: Hey guys. If I do `belongs_to :some_model, optional: true` it allows me to put bogus values in there, ie. an id of 0. Is there a convenient way to validate the existence of the association if it's present and still be optional?
[04:02:13] mikecmpbll: has joined #RubyOnRails
[04:03:07] fryguy: gr33nw00d: what do you want to happen if the value is valid and then becomes invalid later?
[04:03:17] gr33nw00d: Good point. I've re-thought this
[04:03:22] gr33nw00d: I think 0 is an acceptable value
[04:03:24] gr33nw00d: as it computes to nil
[04:03:28] gr33nw00d: thanks for your input fryguy
[04:04:47] kies: has joined #RubyOnRails
[04:08:01] Technodrome: has joined #RubyOnRails
[04:10:18] jottr: has joined #RubyOnRails
[04:15:41] jphase: has joined #RubyOnRails
[04:16:41] jphase_: has joined #RubyOnRails
[04:17:41] jphase__: has joined #RubyOnRails
[04:18:42] jphase___: has joined #RubyOnRails
[04:28:18] chouhoulis: has joined #RubyOnRails
[04:43:12] jphase: has joined #RubyOnRails
[04:44:13] jphase_: has joined #RubyOnRails
[04:47:42] jphase: has joined #RubyOnRails
[04:48:44] jphase_: has joined #RubyOnRails
[04:51:45] worknick: has joined #RubyOnRails
[04:51:45] guacamole: has joined #RubyOnRails
[04:52:17] jphase__: has joined #RubyOnRails
[05:01:48] worknick: my locales are mounted at get ':/locale' => "Controller#action", as: 'myroot'. this workes everywhere except on production. on production nginx just gives a blank page. production on my local machine works. production on real production just gives blank page for `myip/ru` e.g.
[05:02:00] worknick: i am using nginx puma rails 5
[05:02:02] Radar: why ":/locale?
[05:02:08] Radar: why not /:locale?
[05:02:13] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:05:57] AzaToth: has joined #RubyOnRails
[05:06:35] uksio: has joined #RubyOnRails
[05:08:06] worknick: Radar, as given here http://guides.rubyonrails.org/i18n.html
[05:08:44] worknick: ok, I have exact this line get '/:locale' => 'pages#index', as: 'locale_root'
[05:23:32] blackcross: wait, does 0 compute to nil? I thought it computed to true
[05:27:16] Macaveli: has joined #RubyOnRails
[05:27:45] worknick: Radar, any idea?
[05:37:50] jphase: has joined #RubyOnRails
[05:40:15] Radar: blackcross: cod eplz
[05:40:19] Radar: worknick: nope not yet
[05:40:28] Radar: worknick: what does log/production.log show?
[05:42:20] jphase: has joined #RubyOnRails
[05:49:27] worknick: Radar, template not found for this request
[05:49:43] worknick: and i get this error only on production vps. dont get it on local machine production env
[05:49:52] worknick: template missing for /:locale
[05:55:08] worknick: i added respond_to :html in pages index action
[05:55:14] jottr: has joined #RubyOnRails
[05:55:42] dminuoso: Cells without ActionView, opinions?
[05:55:51] dminuoso: (I mean entirely, not just rendering cells from within views)
[06:03:35] segy: has joined #RubyOnRails
[06:17:22] conta: has joined #RubyOnRails
[06:26:57] dionysus69: has joined #RubyOnRails
[06:29:28] snickers: has joined #RubyOnRails
[06:37:41] lethjakman: has joined #RubyOnRails
[07:22:29] Tempesta: has joined #RubyOnRails
[07:31:46] Technodrome: has joined #RubyOnRails
[07:35:04] alfiemax: has joined #RubyOnRails
[07:36:17] DrYockel: has joined #RubyOnRails
[07:38:28] marr: has joined #RubyOnRails
[07:39:07] lethjakman: has joined #RubyOnRails
[07:56:16] Technodrome: has joined #RubyOnRails
[08:03:49] jphase: has joined #RubyOnRails
[08:06:15] jphase_: has joined #RubyOnRails
[08:06:45] dminuoso: SPRING I HATE YOU.
[08:07:35] matthewd: dminuoso: What did it do?
[08:08:28] drale2k_: has joined #RubyOnRails
[08:08:34] matthewd: I only seem to trip on it when running an app pointing at a rails/rails I'm modifying
[08:09:44] jphase: has joined #RubyOnRails
[08:12:03] dminuoso: matthewd: I've had const missing errors during refactoring when I was moving classes into different namespaces. Some classes worked just fine, others didn't.
[08:12:20] dminuoso: Restarting rails had no impact, restarting spring - and voila the code worked.
[08:12:42] dminuoso: (In particular I was migrating old-style cells to trailblazers-cells style)
[08:13:34] matthewd: Ah, maybe it's a feature, then ;)
[08:14:17] jphase_: has joined #RubyOnRails
[08:14:36] matthewd: Creating new files by copy contents [to adjust namespaces etc], or filesystem copy/moving?
[08:15:05] acosonic: Hi, can someone please upvote my question so I can get unbanned on stackoverflow... https://stackoverflow.com/questions/41758923/counting-chars-in-ruby-1-9-3-error Thanks!
[08:18:27] dminuoso: matthewd: filesystem moving
[08:20:02] matthewd: dminuoso: Are you using spring-watcher-listen?
[08:20:26] matthewd: Maybe spring only checks mtime on files, and not their containing directories?
[08:20:40] acosonic: I can't ask new questions...
[08:20:43] dminuoso: matthewd: It would appear so, at least its listed in my Gemfile.lock, or is this something I have to opt-in?
[08:21:29] dminuoso: matthewd: Mmm, it's certainly possible.
[08:22:05] tbuehlmann: acosonic: I assume this has a reason?
[08:23:20] acosonic: tbuehlmann: yup I got into fight with one of moderators, because he told my question was a duplicate, but in fact it was not, there was a difference if you are addressing all attributes with some generic query, or if you are typing them one by one...
[08:23:29] acosonic: So he wouldn't have my question unlocked
[08:24:00] jottr: has joined #RubyOnRails
[08:25:15] ur5us: has joined #RubyOnRails
[08:25:52] acosonic: But then when I looked back I've figured that some of questions could have been improved, so I've improved them...
[08:26:09] acosonic: Now waiting for upvotes, to be able to ask questions again...
[08:26:50] acosonic: basically it was a good thing to get into fight with that guy, because it made me realize that my questions didn't get enough views and didn't get upvotes, but only banning me made me fix that...
[08:27:45] matthewd: dminuoso: I'm sure it's frustrating. That's why I'm trying to work out why it happened :P
[08:28:32] dminuoso: matthewd: I'll try and produce a testcase tomorrow.
[08:28:48] jphase: has joined #RubyOnRails
[08:28:51] matthewd: IMO much of the ongoing spring-pain is that anytime it fails to notice a change, people grumble and turn it off (which is fine -- everyone's got work to do), but don't report it
[08:29:37] matthewd: Especially if the answer turns out to be something as simple as ^^... 'cos if true, that seems like it could explain a good quantity of occasional-but-not-rare misbehaviour
[08:32:15] jottr: has joined #RubyOnRails
[08:33:09] acosonic: why downvote?
[08:36:17] matthewd: dminuoso: Thanks -- to be clear, the above isn't a complaint directed at you... just a meta-whine
[08:37:03] acosonic: tbuehlmann: Why downvoting without telling what's wrong?
[08:37:57] tbuehlmann: what? I don't know
[08:38:44] acosonic: ah, sorry it's not that question :D I've actually got downvoted on one after editing....
[08:39:01] dminuoso: matthewd: Oh well it kind of does apply. I mean normally I might debug this, but spring has been notoriously difficult to debug.
[08:39:15] quazimodo: has joined #RubyOnRails
[08:52:43] sekmo: has joined #RubyOnRails
[08:54:20] workmad3: has joined #RubyOnRails
[09:00:27] dminuoso: matthewd: And I just blew up it again. So.. how do I debug this?
[09:02:14] matthewd: dminuoso: Hmm... I guess the immediate thing is to hopefully recognise what you just did [presumably to files related to the thing it's complaining about] that likely caused it
[09:03:13] matthewd: I'm not familiar enough with spring to have Actual Theories to investigate for debugging... just a repro recipe would be a great outcome
[09:04:51] sekmo: Hi everyone! I'm looking for very simple ruby katas in order to get good with object modelling with Ruby. Where can I find some simple examples?
[09:06:39] Guest28041: has joined #RubyOnRails
[09:07:36] alexday: has joined #RubyOnRails
[09:07:57] Cork: has joined #RubyOnRails
[09:09:33] matthewd: dminuoso: I guess the obvious follow-up would be to drop spring-watcher-listen, and see if that changes things
[09:10:04] alexday: I have an werid thing happening. I didn't add any I18n configuration. I had 2 files in locales/ en.yml id.yml . then I18n.available_locales showed :en, :id . then I added :de . and reloaded. available_locales showed :en :id :de . but now that I deleted the file. it still shows :de in list. why
[09:11:14] matthewd: alexday: I imagine that'll go away after restarting
[09:11:29] matthewd: alexday: Possibly with a `spring stop` for good measure
[09:13:06] alexday: I did restart
[09:15:43] alexday: oh ok I think I got it.
[09:17:28] alexday: has left #RubyOnRails: ("WeeChat 1.8")
[09:19:07] ferr: has joined #RubyOnRails
[09:29:17] dminuoso: matthewd: Im slowly beginning to hate const_missing, something is interfering with const_missing in such a way, that Im giving it Foo::Bar::Quux, but it complains about Bar::Quux as missing.
[09:29:33] dminuoso: This is fun.
[09:30:15] matthewd: I only know of a handful of people who think const_missing is a good thing :/
[09:31:27] matthewd: Said handful of people is more commonly known as "Ruby Core"
[09:31:57] matthewd: Do you have a ::Bar defined?
[09:43:18] lethjakman: has joined #RubyOnRails
[09:45:06] robnester: has joined #RubyOnRails
[09:46:27] aclark: has joined #RubyOnRails
[09:59:36] dminuoso: matthewd: Mmm yes. I'm a bit unsure whether I'm actually using trailblazer-cells incorrectly.
[09:59:56] dminuoso: The more Im poking in this, I'm just surprised it worked _at all_ in between.
[10:08:08] rgr: has joined #RubyOnRails
[10:12:01] stamina: has joined #RubyOnRails
[10:15:03] srinidhi: has joined #RubyOnRails
[10:21:55] BloodyMer: has joined #RubyOnRails
[10:28:02] workmad3: has joined #RubyOnRails
[10:29:41] cabotto: has joined #RubyOnRails
[10:31:17] mikecmpbll: has joined #RubyOnRails
[10:36:22] alfiemax: has joined #RubyOnRails
[10:45:54] jphase: has joined #RubyOnRails
[10:51:41] ajaysingh: has joined #RubyOnRails
[10:52:40] jphase: has joined #RubyOnRails
[11:01:13] quazimodo: has joined #RubyOnRails
[11:07:11] jphase: has joined #RubyOnRails
[11:08:17] jphase_: has joined #RubyOnRails
[11:11:19] cabotto: has joined #RubyOnRails
[11:11:48] jphase__: has joined #RubyOnRails
[11:12:07] Macaveli: has joined #RubyOnRails
[11:15:16] jphase: has joined #RubyOnRails
[11:17:20] drale2k_: has joined #RubyOnRails
[11:23:58] wsilva: has joined #RubyOnRails
[11:24:36] Macaveli: has joined #RubyOnRails
[11:26:41] apparition: has joined #RubyOnRails
[11:34:13] ^mtkd: has joined #RubyOnRails
[11:34:59] alfiemax: has joined #RubyOnRails
[11:35:25] jottr: has joined #RubyOnRails
[11:41:48] drale2k_: has joined #RubyOnRails
[11:44:08] lethjakman: has joined #RubyOnRails
[11:54:43] Hexafox[I]: has joined #RubyOnRails
[11:57:27] drale2k_: has joined #RubyOnRails
[11:59:50] sionronin: has joined #RubyOnRails
[12:04:59] apeiros: has joined #RubyOnRails
[12:05:51] apeiros: apparently setting I18n.exception_handler doesn't help with missing translations in views (as per the guides, the helpers explicitly circumvent the exception handler). so what's the suggested way to hook in a reporter for missing translations?
[12:07:28] keegnotrub: has joined #RubyOnRails
[12:16:17] Macaveli: has joined #RubyOnRails
[12:17:22] apeiros: awesome. looking at ActionView::Helpers::TranslationHelper#translate, it seems the only way to hook into this is by actually monkey patching #translate 😩
[12:17:35] apeiros: if somebody sees a better way, please do tell :-/
[12:19:50] dminuoso: apeiros: So you want something that doesn't raise, but logs?
[12:20:09] dminuoso: apeiros: How good is your test coverage?
[12:20:17] apeiros: or well, actually something which logs and then goes on to perform the default behavior
[12:20:54] apeiros: lets assume non-existent (there are extensive tests, but since the upgrade from rails 3 to rails 5.1 they no longer run and I don't know when they will run again)
[12:20:57] oded: has joined #RubyOnRails
[12:21:29] dminuoso: apeiros: Im a bit confused by what you said "the helpers explicitly cirumvent the exception handler", to which guide are you referring to?
[12:21:31] matthewd: I'm confused
[12:22:07] apeiros: the i18n guides of rubyonrails. confirmed by reading the code of ActionView::Helpers::TranslationHelper#translate
[12:22:37] apeiros: doing <%= t('.missing') %> in your view will not trigger the registered I18n.exception_handler
[12:22:43] matthewd: Where's the circumvention?
[12:22:58] matthewd: https://github.com/rails/rails/blob/56832e791f3ec3e586cf049c6408c7a183fdd3a1/actionview/lib/action_view/helpers/translation_helper.rb#L90
[12:23:14] matthewd: Does `raise: true` there not mean "invoke the registered exception_handler"?
[12:24:21] apeiros: yes. you'd have to replace all places with t(*) with t(*, raise: true)
[12:24:55] apeiros: the default isn't `raise: true`
[12:24:57] jottr: has joined #RubyOnRails
[12:25:03] matthewd: https://github.com/rails/rails/blob/56832e791f3ec3e586cf049c6408c7a183fdd3a1/actionview/lib/action_view/helpers/translation_helper.rb#L76
[12:25:13] apeiros: you can try it if you don't believe me :)
[12:25:19] apeiros: I just did in live code.
[12:27:20] matthewd: I don't have a relevant setup, but that line sure seems to be setting it to true
[12:27:59] apeiros: it doesn't seem to take a path which triggers the registered handler though
[12:28:16] apeiros: and even if, it'd still not actually be the desired behavior.
[12:28:31] apeiros: (which I realized during working on this)
[12:28:45] matthewd: Ah, it looks like I18n doesn't support what you want
[12:29:30] matthewd: Explicit `raise: true` forces it to raise an exception, not invoke the handler
[12:29:49] apeiros: yes, but at least it does then indeed go through the handler :)
[12:29:56] apeiros: at least I get my binding.pry triggered
[12:30:01] matthewd: Right. And you can do that by calling it.
[12:30:35] apeiros: but the point in need to hook in is here anyway: https://github.com/rails/rails/blob/56832e791f3ec3e586cf049c6408c7a183fdd3a1/actionview/lib/action_view/helpers/translation_helper.rb#L93
[12:30:50] apeiros: before dropping to fallbacks, report that a key is missing in one of the supported languages
[12:31:24] matthewd: But a large part of the point of our helper is to wrap and respond to a failure, which means we need to know the lookup failed (thus, we need the default exception, not the result of some unknown replacement handler)
[12:31:28] apeiros: and then continue to actually use the fallbacks, with the last fallback being they key in prod, and the "translation missing" fragment in other envs
[12:31:56] apeiros: yes. that does make sense. what I'd need is a hook.
[12:32:07] apeiros: one which doesn't exist yet.
[12:32:32] apeiros: and my only way to add said hook atm is by monkey patching ActionView::Helpers::TranslationHelper#translate
[12:33:34] tbuehlmann: something similar to https://github.com/fphilipe/i18n-debug/blob/58f66af62467b7c9b1143f958d91d07aba8290ba/lib/i18n/debug.rb probably?
[12:34:28] apeiros: tbuehlmann: that logs every lookup as it seems?
[12:34:37] apeiros: I'll gist my patch when done
[12:35:09] jphase: has joined #RubyOnRails
[12:36:35] matthewd: I guess I'm struggling to equate "I have a specific requirement which means I need code to execute --> here <--" and "burned by a design decision"
[12:36:54] matthewd: Every line that doesn't offer a hook is, strictly, a design decision... buuut...
[12:37:01] apeiros: that was a mistaken assessment by me
[12:37:34] matthewd: That said, I will wear the fact that this is a huge method to have to monkey-patch :/
[12:37:43] apeiros: it's a missing option. and while I do think it's something which should be there by default, it's an added feature, not an obstructed one as I initially thought.
[12:39:00] apeiros: the patch is small. the issue is more with guarding against changes in that method :-/
[12:40:24] dminuoso: https://gist.github.com/dminuoso/3ccc9f11ce0a6c38d64d3d912cd3190b Is this behavior from autoloading to throw this weird exception by design?
[12:40:52] matthewd: module ApplicationHelper; $nested = []; def translate(key, *stuff); unless $nested.empty; p "missing key: #{$nested.last}"; end; begin; $nested << key; super; ensure; $nested.pop; end; end
[12:41:00] matthewd: Something like that?
[12:41:43] matthewd: Oh, that doesn't notice if the last fallback is missing
[12:41:51] dminuoso: If I delete the marked directory, everything is fine.
[12:42:13] dminuoso: (Ruby, why don't you have proper modules support :( )
[12:43:09] matthewd: dminuoso: Yes. The existence of the directory (under an autoload path) means we create a dummy module, to act as a namespace for whatever's inside.
[12:44:05] dminuoso: matthewd: But shouldn't that module be scoped under LoopPathway, i.e. LoopPathway::RolloutZone ?
[12:44:06] matthewd: dminuoso: And then when looking up models for associations, we resolve the constant like it would if referenced inside the module body -- so we explicitly try for LoopPathway::RolloutZone
[12:45:17] dminuoso: matthewd: Why doesn't adding class_name help then?
[12:45:33] matthewd: class_name: "::RolloutZone" should do it
[12:45:55] dminuoso: Ahh it does indeed. Thanks.
[12:46:55] dminuoso: matthewd: Why do you try for LoopPathway::RolloutZone at all?
[12:47:26] dminuoso: I mean that does not appear to be a common convention, to place A inside B (A::B) if A belongs_to B
[12:47:49] matthewd: That's what Ruby would look for if you just referenced `RolloutZone` from there
[12:48:15] matthewd: It's not unheard-of to have something like a User::Profile
[12:48:41] matthewd: But it's really just a special/extreme case of the much more common A::B belongs_to A::C
[12:49:10] dminuoso: matthewd: Oh I see. So essentially the assoiation builder determine the const to be a plain `B`, and the rest is then just nesting?
[12:49:43] dminuoso: Which would explain why setting it explicitly to `::B` helps.
[12:50:13] dminuoso: Okay that makes sense.
[12:50:40] matthewd: We start fully nested under the current model name, then peel off [inner] layers of namespacing, looking for the first defined constant
[12:51:03] matthewd: Which isn't quite what a plain ruby constant reference does, because you have actual static scopes, but is our best approximation
[12:55:55] apeiros: matthewd: https://gist.github.com/apeiros/c5364fd0f5d389fffb377edb63821715
[12:56:14] apeiros: changes are in line 2, 37 and 40
[12:56:20] apeiros: line 37 is added
[12:57:32] apeiros: I'm not quite sure I get how your suggestion above is meant to work
[12:57:42] apeiros: (ApplicationHelper patch)
[12:58:11] apeiros: but I guess it actually makes a lot of sense to override the method in ApplicationHelper or even a custom Helper
[12:58:22] apeiros: instead of monkey patching. much less intrusive.
[12:58:28] matthewd: It relied on detecting the recursion on remaining_defaults
[12:58:56] apeiros: yeah, but globals & threads aren't best friends…
[12:59:15] apeiros: but I guess it was mostly to give an idea?
[12:59:23] matthewd: The global was supposed to be "I'm being lazy and typing this into IRC", yeah ;)
[13:00:34] matthewd: But it doesn't work if there aren't any remaining_defaults, so probably not so useful
[13:01:54] matthewd: The easiest monkey-patch might actually be on I18n.translate itself
[13:02:08] matthewd: Prepend a method on top of that to rescue, log, and re-raise
[13:02:41] apeiros: iirc I did that years ago and it falls short because of not having a distinction between actual lookup and "test whether key exists"
[13:02:58] apeiros: but I could give it another shot
[13:03:40] matthewd: Doesn't distinguish initial_lookup, but I'm not sure whether that's even a disadvantage tbh -- if the log shows all the things that were tried in order, you can decide exactly which you want
[13:04:30] apeiros: yeah, it's different than with the view helper
[13:04:48] apeiros: in the view helper it's about "try lang X first, then fall back to english" and I want it only reported on lang X
[13:05:15] apeiros: in other places it's like "try a.b.c.foo, then a.b.foo, then a.foo"
[13:05:19] matthewd: Oh, actually...
[13:05:30] apeiros: for the latter scenario it mgiht make sense to have all 3 keys so we know which ones have been tried
[13:05:40] mtkd: has joined #RubyOnRails
[13:05:46] apeiros: it'd of course be very nice if we somehow could identify that this was a "lookup group"
[13:06:00] matthewd: Override the helper, and in there: super(*everything, raise: true); rescue; log; super(*everything, raise: false)
[13:06:11] dviola: has joined #RubyOnRails
[13:06:59] apeiros: ACTION ponders the side effects of calling it twice
[13:07:34] apeiros: all that comes to mind is a slow-down, but only in case of missing localizations and probably only academic too. that seems acceptable
[13:07:47] mtkd: has joined #RubyOnRails
[13:08:02] matthewd: It's an expensive way of re-using the 'missing' handler, but yeah, doesn't seem terrible
[13:08:14] chouhoulis: has joined #RubyOnRails
[13:08:26] apeiros: I'll give it a shot. thanks :)
[13:25:43] FastJack: has joined #RubyOnRails
[13:26:23] rgr_: has joined #RubyOnRails
[13:27:03] chouhoulis: has joined #RubyOnRails
[13:32:08] apeiros: matthewd: I think the I18n handler kicks in outside of all that. the moment the exception is suppressed in translate, it is not invoked. I haven't yet followed the code path.
[13:32:30] apeiros: I'll still use that approach, though. I'll just add the handling in there.
[13:33:01] matthewd: Oh, you might need `raise: nil` instead of explicit `raise: false`?
[13:33:10] matthewd: (or just omit it entirely)
[13:35:53] apeiros: I used the original options in the 2nd super
[13:36:22] apeiros: that is, I added an if/else (if options[:raise] == true; raise; else super(key, options); end)
[13:37:48] matthewd: Hmm. And what's happening?
[13:39:38] apeiros: the same as without having that helper. i.e. it'll render the html fragment and not trigger the I18n.exception_handler
[13:40:56] drale2k_: has joined #RubyOnRails
[13:41:01] apeiros: I have it now (simplified) as: `def t(key, options); super(key, options.merge(raise: true)); rescue … => e; if options[:raise]; raise; else; __REPORT__(e); super(key, options); end; end`
[13:41:15] apeiros: simplified since I can't copy & paste (work machine can't reach irc)
[13:43:58] matthewd: Ohhh, right, sorry.. yeah, that was what I meant
[13:45:20] lethjakman: has joined #RubyOnRails
[13:50:04] agent_white: has joined #RubyOnRails
[13:50:32] mikecmpbll: has joined #RubyOnRails
[13:52:07] jdeen_: has joined #RubyOnRails
[13:53:45] drale2k_: has joined #RubyOnRails
[13:54:17] apeiros: now I just need to figure out why airbrake 7.1 + errbit 0.7 no longer logs the env properly :(
[13:54:21] blackmesa: has joined #RubyOnRails
[13:58:01] safetypin: has joined #RubyOnRails
[13:59:31] powrtoch: has joined #RubyOnRails
[14:00:28] ziyanjdeen: has joined #RubyOnRails
[14:01:16] ziyanjdeen: How would we test an oauth implementation (Rails/Doorkeeper) in another app?
[14:01:45] ziyanjdeen: I am writing a zapier app, I got a rails application with doorkeeper setup. I am wondering how to test authentication.
[14:02:36] ziyanjdeen: normal oauth involves the browser, so when we run tests, is there a way lets say to use a username password to get a 'code' ?
[14:05:23] tcopeland: has joined #RubyOnRails
[14:21:07] safetypin: has joined #RubyOnRails
[14:41:06] FrostCandy: has joined #RubyOnRails
[14:42:48] blackmesa: has joined #RubyOnRails
[14:44:10] bruno-: has joined #RubyOnRails
[14:48:52] TakumoKatekari: Hi all, not sure if this is really a Rails question or a general web dev question, but I'm trying to provide SSO from another app such that the authentication flow is transparent to the user
[14:50:28] TakumoKatekari: So I've built app A, and in another app B, there's a button which when clicked will do all the auth stuff transparently and will open a js modal with an embedable version of app A in it
[14:51:00] TakumoKatekari: whereby app B has provided app A with all the user information and app A has somehow provided back credentials for the browser of the user on app B to use app A
[14:51:05] TakumoKatekari: does any of that make any sense at all?
[14:51:22] EXCHGR: has joined #RubyOnRails
[14:51:54] ShalokShalom: has joined #RubyOnRails
[14:53:19] orbyt_: has joined #RubyOnRails
[14:54:04] EXCHGR: has joined #RubyOnRails
[14:55:39] TakumoKatekari: I was thinking that app B could send a POST request to an endpoint containing the user details along with a HMAC of the request enciphered with a shared secret
[14:55:50] TakumoKatekari: but then not sure how to pass back the access credentials to the user
[14:56:03] TakumoKatekari: hmmm actually...
[15:05:28] gusrub: has joined #RubyOnRails
[15:09:00] dionysus69: has joined #RubyOnRails
[15:11:33] troys: has joined #RubyOnRails
[15:17:05] chouhoulis: has joined #RubyOnRails
[15:35:22] ResidentBiscuit: has joined #RubyOnRails
[15:35:47] ResidentBiscuit: has joined #RubyOnRails
[15:36:22] ResidentBiscuit: has joined #RubyOnRails
[15:36:47] ResidentBiscuit: has joined #RubyOnRails
[15:39:17] drale2k_: has joined #RubyOnRails
[15:42:03] gusrub: has joined #RubyOnRails
[15:46:13] lethjakman: has joined #RubyOnRails
[16:02:03] Macaveli: has joined #RubyOnRails
[16:02:47] mostlybadfly: has joined #RubyOnRails
[16:09:38] orbyt_: has joined #RubyOnRails
[16:10:45] kies: has joined #RubyOnRails
[16:18:50] orbyt_: has joined #RubyOnRails
[16:20:41] Papierkorb: has left #RubyOnRails: ("Konversation terminated!")
[16:21:08] blackmesa: has joined #RubyOnRails
[16:22:49] weaksauce: has joined #RubyOnRails
[16:31:03] mtkd: has joined #RubyOnRails
[16:33:31] Technodrome: has joined #RubyOnRails
[16:40:21] mochiyoda_: has joined #RubyOnRails
[16:42:56] workmad3: has joined #RubyOnRails
[16:45:58] snickers: has joined #RubyOnRails
[16:49:11] [Butch]: has joined #RubyOnRails
[16:59:33] orbyt_: has joined #RubyOnRails
[17:02:10] one_zero: has joined #RubyOnRails
[17:09:04] ResidentBiscuit: has joined #RubyOnRails
[17:09:32] blackmesa: has joined #RubyOnRails
[17:18:38] Macaveli: has joined #RubyOnRails
[17:22:55] hahuang65: has joined #RubyOnRails
[17:30:11] weaksauce: has joined #RubyOnRails
[17:31:29] orbyt_: has joined #RubyOnRails
[17:35:07] fmcgeough: has joined #RubyOnRails
[17:43:11] conta: has joined #RubyOnRails
[17:43:54] coder2000: You could use a method like SASL
[17:47:02] lethjakman: has joined #RubyOnRails
[17:48:50] moei: has joined #RubyOnRails
[17:51:37] chouhoulis: has joined #RubyOnRails
[17:53:16] dionysus69: has joined #RubyOnRails
[17:54:41] orbyt_: has joined #RubyOnRails
[18:00:40] guacamole: has joined #RubyOnRails
[18:08:24] justrying: has joined #RubyOnRails
[18:13:39] dionysus69: has joined #RubyOnRails
[18:19:48] lacour: has joined #RubyOnRails
[18:21:04] maxmanders: has joined #RubyOnRails
[18:23:26] Technodrome: has joined #RubyOnRails
[18:33:19] chouhoulis: has joined #RubyOnRails
[18:41:04] blackmesa: has joined #RubyOnRails
[19:00:36] rietta: has left #RubyOnRails: ()
[19:08:17] quazimodo: has joined #RubyOnRails
[19:20:58] Technodrome: has joined #RubyOnRails
[19:22:15] blackmesa: has joined #RubyOnRails
[19:31:51] jfelchner: has joined #RubyOnRails
[19:41:33] lxsameer: has joined #RubyOnRails
[19:43:22] atrius: has joined #RubyOnRails
[19:48:11] lethjakman: has joined #RubyOnRails
[19:55:10] Technodrome: has joined #RubyOnRails
[20:02:47] coder2000: has joined #RubyOnRails
[20:09:35] workmad3: has joined #RubyOnRails
[20:24:10] ur5us: has joined #RubyOnRails
[20:29:35] kapil___: has joined #RubyOnRails
[20:35:17] fmcgeough_: has joined #RubyOnRails
[20:43:38] ProofTechnique: has joined #RubyOnRails
[20:44:57] ferr: has joined #RubyOnRails
[20:52:55] sinduck: has joined #RubyOnRails
[21:31:38] lunarkitty7: ufff, I have a test that fails, but when I manually test the controller it works as expected...
[21:38:01] lunarkitty7: https://gist.github.com/lunarfyre7/8e0648171ebedc143c92951c4321e00b
[21:49:05] lethjakman: has joined #RubyOnRails
[21:54:40] mr-spoon: has joined #RubyOnRails
[22:06:56] nickjj: has joined #RubyOnRails
[22:10:12] mr-spoon: has joined #RubyOnRails
[22:10:26] workmad3: has joined #RubyOnRails
[22:29:27] alfie: has joined #RubyOnRails
[22:33:00] alfie: has joined #RubyOnRails
[22:47:41] orbyt_: has joined #RubyOnRails
[23:03:28] guacamole: has joined #RubyOnRails
[23:05:12] tcopeland: has joined #RubyOnRails
[23:06:37] quazimodo: has joined #RubyOnRails
[23:09:41] GodFather: has joined #RubyOnRails
[23:11:09] Ergo: has joined #RubyOnRails
[23:13:42] tpendragon: has joined #RubyOnRails
[23:27:21] jphase: has joined #RubyOnRails
[23:37:13] jphase: has joined #RubyOnRails
[23:44:38] blackmesa: has joined #RubyOnRails
[23:49:54] lethjakman: has joined #RubyOnRails
[23:52:17] orbyt_: has joined #RubyOnRails
[23:52:20] guacamole: has joined #RubyOnRails
[23:52:30] newton: if I have a rails app on sub.domain.com, is it possible to have `Request#subdomain` treat sub as a subdomain?
[23:52:45] newton: `Rack::Request` even
[23:53:41] newton: *not treat :^)
[23:56:49] safetypin: has joined #RubyOnRails
[23:57:11] gusrub: has joined #RubyOnRails