Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Base#[] and Base#[]= are aliases so implement them as aliases…

… :)"

This reverts commit 21eadc1.
  • Loading branch information...
commit dcebe7fc9c309b29a46e0920b8faf8da9e911cc8 1 parent 701afab
@tomstuart tomstuart authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 activerecord/lib/active_record/attribute_methods.rb
10 activerecord/lib/active_record/attribute_methods.rb
@@ -20,13 +20,15 @@ module AttributeMethods #:nodoc:
# Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
# "2004-12-12" in a data column is cast to a date object, like, 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 <tt>attr_name</tt> 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
module ClassMethods

2 comments on commit dcebe7f


Huh, why hasn't this worked?


It is good to add a separate paragraph in the commit message with a rationale for the archives.

Please sign in to comment.
Something went wrong with that request. Please try again.