diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index c5834e2fef4184db7831237fa54eef62e3650975..02543db2cef5f03cdd5f359717cbafb896728544 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -20,13 +20,15 @@ module AttributeMethods #:nodoc: # Returns the value of the attribute identified by attr_name after it has been typecast (for example, # "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)). # (Alias for the protected read_attribute method). - alias [] read_attribute + def [](attr_name) + read_attribute(attr_name) + end # Updates the attribute identified by attr_name with the specified +value+. # (Alias for the protected write_attribute method). - alias []= write_attribute - - public :[], :[]= + def []=(attr_name, value) + write_attribute(attr_name, value) + end end module ClassMethods