diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 18:45:30 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-07 18:45:30 -0800 |
commit | ec960c3730ed34b3163a267b665daf6d7d024028 (patch) | |
tree | 091db1aacd30553a3239387f3a760defdf7f4c27 /activerecord | |
parent | 36d7bd189818eb1bb0df4f9472113cf70cd652de (diff) | |
download | rails-ec960c3730ed34b3163a267b665daf6d7d024028.tar.gz rails-ec960c3730ed34b3163a267b665daf6d7d024028.tar.bz2 rails-ec960c3730ed34b3163a267b665daf6d7d024028.zip |
join the cult of cargo. reduce the number of NoMethodErrors in the system
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index b77076983e..660fa9a564 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -55,7 +55,7 @@ module ActiveRecord # Define read method for serialized attribute. def define_read_method_for_serialized_attribute(attr_name) access_code = "@attributes_cache['#{attr_name}'] ||= unserialize_attribute('#{attr_name}')" - generated_attribute_methods.module_eval("def #{attr_name}; #{access_code}; end", __FILE__, __LINE__) + generated_attribute_methods.module_eval("def _#{attr_name}; #{access_code}; end; alias #{attr_name} _#{attr_name}", __FILE__, __LINE__) end # Define an attribute reader method. Cope with nil column. |