Skip to content

Commit ec960c3

Browse files
committed
join the cult of cargo. reduce the number of NoMethodErrors in the system
1 parent 36d7bd1 commit ec960c3

File tree

1 file changed

+1
-1
lines changed
  • activerecord/lib/active_record/attribute_methods

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/attribute_methods/read.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def cacheable_column?(column)
5555
# Define read method for serialized attribute.
5656
def define_read_method_for_serialized_attribute(attr_name)
5757
access_code = "@attributes_cache['#{attr_name}'] ||= unserialize_attribute('#{attr_name}')"
58-
generated_attribute_methods.module_eval("def #{attr_name}; #{access_code}; end", __FILE__, __LINE__)
58+
generated_attribute_methods.module_eval("def _#{attr_name}; #{access_code}; end; alias #{attr_name} _#{attr_name}", __FILE__, __LINE__)
5959
end
6060

6161
# Define an attribute reader method. Cope with nil column.

0 commit comments

Comments
 (0)