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

Ignore metadata for frozen classes. #305

Merged
merged 1 commit into from
Nov 1, 2016

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Jan 20, 2015

This makes test suite pass with Ruby 2.2. Basically, it tries to avoid modification of frozen object due to translation metadata.

However, I am not really sure if this is the best approach. May be the translated object should be always just some kind of facade, since for some cases the metadata won't be available. On the other hand, this is not new error, it is just more exposed due to frozen true/false objects in Ruby 2.2

@radar
Copy link
Collaborator

radar commented Nov 1, 2016

Thanks for this fix :) I was taking a look at this yesterday too and came up with roughly the same code.

return {} if frozen?
@translation_metadata ||= {}

It's not much different, so I'm going to merge your changes as-is.

Thanks for your contribution!

@radar radar merged commit da16b95 into ruby-i18n:master Nov 1, 2016
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.

2 participants