aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAditya Sanghi <asanghi@me.com>2010-11-29 18:13:17 +0530
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-08 15:51:47 -0800
commit7a237d56aa38c51987af0fd52d001989c4f3da07 (patch)
treed118c8bc7f9e1e4d25d2bb54d491d24899e610f3 /activerecord/lib/active_record/base.rb
parent285f456391014c6e5ce1a694d43088012fbc7772 (diff)
downloadrails-7a237d56aa38c51987af0fd52d001989c4f3da07.tar.gz
rails-7a237d56aa38c51987af0fd52d001989c4f3da07.tar.bz2
rails-7a237d56aa38c51987af0fd52d001989c4f3da07.zip
Ensure that boolean false is properly serialized [#6079 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b55aaddbd7..7b9ce21ceb 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1680,7 +1680,7 @@ MSG
if include_readonly_attributes || (!include_readonly_attributes && !self.class.readonly_attributes.include?(name))
value = read_attribute(name)
- if value && self.class.serialized_attributes.key?(name)
+ if !value.nil? && self.class.serialized_attributes.key?(name)
value = YAML.dump value
end
attrs[self.class.arel_table[name]] = value