[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?

[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.

[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: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...

[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: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.

[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: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: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

[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

[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