We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36d7bd1 commit ec960c3Copy full SHA for ec960c3
activerecord/lib/active_record/attribute_methods/read.rb
@@ -55,7 +55,7 @@ def cacheable_column?(column)
55
# Define read method for serialized attribute.
56
def define_read_method_for_serialized_attribute(attr_name)
57
access_code = "@attributes_cache['#{attr_name}'] ||= unserialize_attribute('#{attr_name}')"
58
- 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__)
59
end
60
61
# Define an attribute reader method. Cope with nil column.
0 commit comments