1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/guides
Jon Moss 835246e622 Add note about JSON/JSONB serialization changes
The initial commit (efaa6e4f79) that changed this
behavior was intended to be a minor change, but ended up becoming a
large-ish breaking change within Active Record.

This is because instead of only JSON encoding `Hash`es or `Array`s in `#serialize`,
we now encode all values passed in. This is an issue if you're passing in a `String`,
that has already been transformed from a `Hash` to a `String`, since your data
is now being double encoded.

Unfortunately, the change was included in one of the v5.0.0 beta
releases, and it is too late to revert without huge ripple effects.
Thus, all we can do is update the documentation (via this commit), and
add some test coverage (coming soon in a PR) for the new behavior.

Please note that in the documentation I talk about deserialization, not
about serialization, where the actual change occurred. This is because
you won't notice any changes in serialized data until you try and
deserialize it. Also to make the change itself (confusing until you
read through everything multiple times) easier to understand.

Related #27788, #25594, #26101, #24234, #28292, #28285, #28285, and
probably others.

[ci skip]
2017-08-17 13:45:19 -04:00
..
assets Shrink image files in the guides using ImageOptim 2017-06-21 01:39:36 +09:00
bug_report_templates Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00
rails_guides Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00
source Add note about JSON/JSONB serialization changes 2017-08-17 13:45:19 -04:00
.document
CHANGELOG.md Start Rails 5.2 development 2017-03-22 10:11:39 +10:30
rails_guides.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00
Rakefile Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00
w3c_validator.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00