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

Always store errors details information with symbols #26552

Merged
merged 1 commit into from Sep 19, 2016

Conversation

@rafaelfranca
Copy link
Member

commented Sep 19, 2016

When the association is autosaved we were storing the details with string keys. This was creating inconsistency with other details that are added using the Errors#add method. It was also inconsistent with the Errors#messages storage.

To fix this inconsistency we are always storing with symbols. This will cause a small breaking change because in those cases the details could be accessed as strings keys but now it can not.

Fix #26499.

[Rafael Mendonça França + Marcus Vieira]

@rafaelfranca rafaelfranca force-pushed the rafaelfranca:fix-errors-details-storage branch 2 times, most recently Sep 19, 2016

Always store errors details information with symbols
When the association is autosaved we were storing the details with
string keys. This was creating inconsistency with other details that are
added using the `Errors#add` method. It was also inconsistent with the
`Errors#messages` storage.

To fix this inconsistency we are always storing with symbols. This will
cause a small breaking change because in those cases the details could
be accessed as strings keys but now it can not.

The reason that we chose to do this breaking change is because `#details`
should be considered a low level object like `#messages` is.

Fix #26499.

[Rafael Mendonça França + Marcus Vieira]

@rafaelfranca rafaelfranca force-pushed the rafaelfranca:fix-errors-details-storage branch to d406014 Sep 19, 2016

@rafaelfranca

This comment has been minimized.

Copy link
Member Author

commented Sep 19, 2016

@matthewd are you fine with backporting this to 5-0-stable?

@rafaelfranca rafaelfranca merged commit c40c0fe into rails:master Sep 19, 2016

0 of 2 checks passed

codeclimate Code Climate is analyzing this code.
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@rafaelfranca rafaelfranca deleted the rafaelfranca:fix-errors-details-storage branch Sep 19, 2016

@matthewd

This comment has been minimized.

Copy link
Member

commented Sep 20, 2016

👍

rafaelfranca added a commit that referenced this pull request Sep 20, 2016
Merge pull request #26552 from rafaelfranca/fix-errors-details-storage
Always store errors details information with symbols
@rafaelfranca

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2016

Backported in ac0c589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.