Path: | doc/release_notes/3.45.0.txt |
Last Update: | Sat Aug 17 05:34:45 +0000 2013 |
By default, Sequel only retries the block 5 times by default, to protect against infinite looping. You can change the number of retries with the :num_retries option.
Users of the :disconnect=>:retry option are encouraged to switch to :retry_on=>Sequel::DatabaseDisconnectError.
Album.from_xml(album.to_xml) == album
Unfortunately, that requires that the deserialization allow the setting of any column. Since the plugins also handle associations, you could also set any column in any associated object, even cascading to associated objects of those objects.
The new default behavior only allows deserialization to set the same columns that mass-assignment would set, and not to handle associated objects at all by default. The following additional options are supported:
:fields :: The specific fields to set (this was already supported by the json_serializer plugin). :associations :: The specific associations to handle. :all_columns :: The previous behavior of setting all columns. :all_associations :: The previous behavior of setting all associations.
Since JSON parsing no longer deserializes into arbitrary ruby instances, from_json and array_from_json class methods have been added to the json_serializer plugin, for deserializing into model instances. These mirror the from_xml and array_from_xml class methods in the xml_serializer plugin.
Note that the :all_columns and :all_associations methods were only added to make backwards compatibility easier. It is likely they will be removed in Sequel 4, along with the json_create class method.
Note that it‘s not just this new version of Sequel that will cause that, older versions of Sequel will break in the same way if you update your JSON library to a version that is not vulnerable by default.
This potentially affects the pg_json extension and serialization plugin if you were expecting the JSON stored in the database to be deserialized into arbitrary ruby objects.
See the json_serializer/xml_serializer changes mentioned in the Other Improvements section.
Additionally, using a nonexistent table name will raise an exception instead of returning empty results in some cases.