Skip to content
Browse files

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

… :)"

This reverts commit 21eadc1.
  • Loading branch information...
1 parent cda5094 commit f707cda53c58e42e1a93bfe533ca3d460d5ff9c9 @tomstuart tomstuart committed Jan 11, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 activerecord/lib/active_record/base.rb
View
10 activerecord/lib/active_record/base.rb
@@ -2173,13 +2173,15 @@ def clear_timestamp_attributes
# 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
end

0 comments on commit f707cda

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