aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorTom Stuart <tom@experthuman.com>2012-01-11 10:00:39 +0000
committerTom Stuart <tom@experthuman.com>2012-01-11 10:14:21 +0000
commitdcebe7fc9c309b29a46e0920b8faf8da9e911cc8 (patch)
treead6cf4ecb4af629de49be4adc4e7b6c6672c4b59 /activerecord/lib
parent701afabd3d025ecca987c94b7b94dc93ef80ccfc (diff)
downloadrails-dcebe7fc9c309b29a46e0920b8faf8da9e911cc8.tar.gz
rails-dcebe7fc9c309b29a46e0920b8faf8da9e911cc8.tar.bz2
rails-dcebe7fc9c309b29a46e0920b8faf8da9e911cc8.zip
Revert "Base#[] and Base#[]= are aliases so implement them as aliases :)"
This reverts commit 21eadc1b3f2eb818a4833381ee0a6cfa205f2955.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index c5834e2fef..02543db2ce 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -20,13 +20,15 @@ module ActiveRecord
# 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 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 <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
end
module ClassMethods