Skip to content
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

Fix i18n lookup for unauthorized message #416

Merged
merged 2 commits into from Nov 10, 2017
Merged

Fix i18n lookup for unauthorized message #416

merged 2 commits into from Nov 10, 2017

Conversation

clemens
Copy link
Contributor

@clemens clemens commented May 31, 2017

Looking up `nil` doesn't make sense. So instead, we treat the first key in the `keys` array as the actual desired key and the remainder as potential fallbacks for `default`.
@coorasse
Copy link
Member

Thank you @clemens, I think we need a test here to proove that the issue is really solved, so a test that would actually fail without your changes and passes with them. Thanks for your contribution! Really appreciated.

@clemens
Copy link
Contributor Author

clemens commented May 31, 2017

What do you have in mind for that test? A mock that expects a call with a certain key? Otherwise we'd have to test against a specific version of i18n – which seems questionable.

@coorasse coorasse merged commit 6d88296 into CanCanCommunity:develop Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants