-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
find_by modifies argument #284
Comments
Can you write a test for this? Yes globalize does modify the attributes, that's not a bug. But we hadn't considered non-modifiable hashes. |
Here's the relevant code: https://github.com/globalize/globalize/blob/master/lib/globalize/active_record/relation.rb#L54 |
Actually this is a good catch, thanks. We just need to BTW this is not a problem only with |
Try the branch I just created: gem 'globalize', github: 'globalize/globalize', branch: 'issue_284_find_by_arguments' This should fix the modifying arguments issue. |
This also seems to fix #283 , if so I'll just write a test for that and close both issues. |
argument to find_by is modified now by method
At least 2 tests now fail:
term = model.find_by(attrs) || model.create!(attrs)
term = model.find_by( non_modifiable_hash )
This may be related to #282
The text was updated successfully, but these errors were encountered: