提交 dcebe7fc 编写于 作者: T Tom Stuart

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

This reverts commit 21eadc1b.
上级 701afabd
......@@ -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 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册