aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorDiego Carrion <dc.rec1@gmail.com>2015-06-12 18:19:00 -0300
committerDiego Carrion <dc.rec1@gmail.com>2015-06-12 18:19:00 -0300
commit167ce0871b8deb714849583dc95982e9865636f3 (patch)
treec4605e46a59cafffba3bcd45bb6ffa5651f8a834 /activerecord/lib/active_record/attribute_methods
parent65cd9f7694a4791b9b8515073b9b1623c0970e79 (diff)
downloadrails-167ce0871b8deb714849583dc95982e9865636f3.tar.gz
rails-167ce0871b8deb714849583dc95982e9865636f3.tar.bz2
rails-167ce0871b8deb714849583dc95982e9865636f3.zip
add doc about how empty serialization objects are persisted
the test case for this commit is in cd3f5db
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/serialization.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb
index fd7099e0de..ede8bba922 100644
--- a/activerecord/lib/active_record/attribute_methods/serialization.rb
+++ b/activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -11,6 +11,8 @@ module ActiveRecord
# serialized object must be of that class on assignment and retrieval.
# Otherwise <tt>SerializationTypeMismatch</tt> will be raised.
#
+ # Empty objects as +{}+ in the case of +Hash+ or +[]+ in the case of +Array+ will always be persisted as null.
+ #
# Keep in mind that database adapters handle certain serialization tasks
# for you. For instance: +json+ and +jsonb+ types in PostgreSQL will be
# converted between JSON object/array syntax and Ruby +Hash+ or +Array+