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

Add test case for interpolation with passing of data along with record #24431

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

vipulnsward
Copy link
Member

Follow-up of #24119

r? @rafaelfranca

…d attribute in error message, where a proc is passed.
@vipulnsward
Copy link
Member Author

@rafaelfranca @prathamesh-sonpatki #24119 is kind of a breaking change, before that we returned "activemodel.errors.models.topic.attributes.title.blank" as first key in this example (as documented here- #22427 it's newly documented though), and now we return object.

@prathamesh-sonpatki
Copy link
Member

That's true. Because here - https://github.com/svenfuchs/i18n/blob/aee7b3f6072fba3f54798a280bd6007536b039cd/lib/i18n/backend/base.rb#L120-L121

We check for presence of object in options first and if not we pass the key (activemodel.errors.models.topic.attributes.title.blank) passed from Rails to the proc.

After #24119, the options[:object] will always be not null so key won't be passed to proc.

Can a key be used in the proc with proper usecase? The example in #22427 didn't use it.

@rafaelfranca
Copy link
Member

Urgh. Lets change the example added in #22427 to match this new API and add a CHANGELOG entry about it.

@prathamesh-sonpatki
Copy link
Member

Ok. Will take care of it.

prathamesh-sonpatki added a commit to prathamesh-sonpatki/rails that referenced this pull request Apr 6, 2016
…records [ci skip]

- This change is made as the behavior for `:message` proc was changed in
  rails#24119.
- Also check
  rails#24431 (comment) for
  reference.
@rafaelfranca rafaelfranca merged commit 2d20bdf into rails:master Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants