提交 65df7b37 编写于 作者: J Jon Leighton

no need to define methods in included hook

上级 641611a6
......@@ -16,19 +16,6 @@ module AttributeMethods #:nodoc:
include TimeZoneConversion
include Dirty
include Serialization
# 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).
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).
def []=(attr_name, value)
write_attribute(attr_name, value)
end
end
module ClassMethods
......@@ -192,6 +179,19 @@ def column_for_attribute(name)
self.class.columns_hash[name.to_s]
end
# 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).
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).
def []=(attr_name, value)
write_attribute(attr_name, value)
end
protected
def clone_attributes(reader_method = :read_attribute, attributes = {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册