-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix crash when available locales are enforced but fallback locale unavailable #1796
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
Conversation
d70a565 to
100c705
Compare
spec/grape/exceptions/base_spec.rb
Outdated
| after do | ||
| I18n.available_locales = %i[de en] | ||
| I18n.enforce_available_locales = false | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These probably mess up global state, so the entire spec here should have some kind of after block that restores I18n options to default rather than to de/en.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblock How about the enforce_available_locales setting? As far as I can see, the default setting for this is true, so should that be the default setting for all specs too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like it. If you want to be sure set it globally in spec_helper.rb.
336fafa to
7ee0007
Compare
|
Not sure why the rails edge test is failing actually, seems to be an issue within ActiveSupport? 🤔 |
|
Yeah, see #1795 (comment). First one to fix gets their PR merged ;) |
0169aad to
7e3af39
Compare
7e3af39 to
7b18778
Compare
7b18778 to
f0d1fa1
Compare
|
I merged this. |
|
Thanks @Morred ! |
truein the spec helper because this reflects the default settings for a standard Rails app