From 39cb1bedb82814d7bf9de6834f88c31e4df27278 Mon Sep 17 00:00:00 2001 From: Kirill Lashuk Date: Sat, 28 Jan 2012 05:10:13 +0300 Subject: Do not serialize nil in serialized attribute. --- activerecord/lib/active_record/coders/yaml_column.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/coders/yaml_column.rb b/activerecord/lib/active_record/coders/yaml_column.rb index fb59d9fb07..77af540c3e 100644 --- a/activerecord/lib/active_record/coders/yaml_column.rb +++ b/activerecord/lib/active_record/coders/yaml_column.rb @@ -15,7 +15,7 @@ module ActiveRecord end def dump(obj) - YAML.dump obj + YAML.dump(obj) unless obj.nil? end def load(yaml) -- cgit v1.2.3