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
Make the order of Hash#reverse_merge! consistent with HashWithIndifferentAccess #28077
Make the order of Hash#reverse_merge! consistent with HashWithIndifferentAccess #28077
Conversation
r? @sgrif (@rails-bot has picked a reviewer for you, use r? to override) |
Probably not a concern in any realistic use cases for this function, but this change does make an extra copy of the original |
That's true. What I also haven't done yet is run a benchmark to see the impact. It does make the implementation simpler to maintain, since it's the same as
A further improvement could be to remove the method definition there, since it inherits from |
45c91d2
to
d5b590d
Compare
What do you think of this change @sgrif? |
20bb336
to
e505bc8
Compare
Hi @maclover7, anyone I can consult this with? |
Hi @rafaelfranca just wanted to consult with you about this change. If this is something that can be merged, I can have the PR rebased |
Just saw this, thanks @sgrif |
…?/attribute_changed? for after_save callbacks. (#4000) * update classification.rb in rails 5.2 Hash#reverse_merge! behavior changes See rails/rails#28077 See: https://guides.rubyonrails.org/5_2_release_notes.html * update updatable_resource.rb to replace deprecated changed? to saved_changes? * Update Gemfile.next.lock * Update Gemfile.next.lock * updating changes?/attribute_changed? behavior for after_save callbacks https://www.fastruby.io/blog/rails/upgrades/active-record-5-1-api-changes.html * revert saved_changes? to changed? in updatable resource. only use saved_changes? for after_save callbacks * hound sniff update user.rb set_zooniverse_id if clause to single line * add spec to test if the missing email_communication field is set correctly * always modify the resource updated_at when updating links * update find_or_create to use more readable has_changes_to_save as opposed to changed? (incorrectly used saved_changes? on initial fix) * simplify assignment to upp.email_communication on find_or_create.rb * update find_or_create_spec.rb spec that checks if email_communication is set Co-authored-by: Campbell Allen <campbell.allen@gmail.com>
Summary
Currently, the result of
Hash#reverse_merge!
deviates from the ordering of similar methods:This PR aims to make the element order consistent across the 4 methods such that: