Skip to content

Commit

Permalink
Revert "Base#[] and Base#[]= are aliases so implement them as aliases…
Browse files Browse the repository at this point in the history
… :)"

This reverts commit 21eadc1.
  • Loading branch information
tomstuart committed Jan 12, 2012
1 parent cda5094 commit f707cda
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions activerecord/lib/active_record/base.rb
Expand Up @@ -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, # 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)). # "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 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+. # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+.
# (Alias for the protected write_attribute method). # (Alias for the protected write_attribute method).
alias []= write_attribute def []=(attr_name, value)

write_attribute(attr_name, value)
public :[], :[]= end
end end
end end


Expand Down

0 comments on commit f707cda

Please sign in to comment.