diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-20 17:33:26 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-20 19:47:15 -0800 |
commit | 207f266ccaaa9cd04cd2a7513ae5598c4358b510 (patch) | |
tree | e197d33af7d701d183ed326f7d1c63b915b26fc7 /activemodel/lib/active_model | |
parent | 099a210c837daae692154add3b9da0a207825d35 (diff) | |
download | rails-207f266ccaaa9cd04cd2a7513ae5598c4358b510.tar.gz rails-207f266ccaaa9cd04cd2a7513ae5598c4358b510.tar.bz2 rails-207f266ccaaa9cd04cd2a7513ae5598c4358b510.zip |
define_attr_method must serialize nil correctly
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index fc5f5c4c66..33454123ce 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -109,7 +109,7 @@ module ActiveModel # use eval instead of a block to work around a memory leak in dev # mode in fcgi sing.class_eval <<-eorb, __FILE__, __LINE__ + 1 - def #{name}; #{value.to_s.inspect}; end + def #{name}; #{value.nil? ? 'nil' : value.to_s.inspect}; end eorb end end |