-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails app crashes when a null locale is present #59
Comments
@CDingerdis This is the issue we ran in to. Wanna check out the proposed solution? |
Thank you, this information helped me alot! |
* Checking for this NULL value because the Rails (clients) app crashes with the following message: /Users/sajoku/.rvm/gems/ruby-2.2.0/bundler/gems/i18n-active_record-2d9a2 2b6a4e5/lib/i18n/backend/active_record/translation.rb:76:in `block in available_locales': undefined method `to_sym' for nil:NilClass (NoMethodError) from /Users/sajoku/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_re cord/relation/delegation.rb:46
@rvfx Awesome 😄 I haven't tested this with anything other than MySQL though, so be careful just implementing this with anything other than that. |
Hey @sajoku |
A bit late but I'll close this issue as I believe this is a non-issue for other people. |
Today I was investigating a startup failure in a Rails app with the following error:
After some investigation the error led me (and my pair buddy) to the translations table in the database and check all the translations. The last two entries had NULL as :locale. Removing this fixed the startup issue.
I'm not sure if my "fix" is desirable but wanna check this out and let me know what you think?
sajoku@2f563cd
The reason I'm not sure is because this seems to be something the user could simply fix by making sure locale has a default value or can't be NULL in the database. What are your thought on this?
Or maybe let the user know in te README (or wiki perhaps?)?
sajoku@b284fee
The text was updated successfully, but these errors were encountered: