adding a comment for myself
This commit is contained in:
parent
5dec3dd59c
commit
3e0ecde208
@ -194,6 +194,7 @@ def attribute_present?(attribute)
|
|||||||
|
|
||||||
# Returns the column object for the named attribute.
|
# Returns the column object for the named attribute.
|
||||||
def column_for_attribute(name)
|
def column_for_attribute(name)
|
||||||
|
# FIXME: should this return a null object for columns that don't exist?
|
||||||
self.class.columns_hash[name.to_s]
|
self.class.columns_hash[name.to_s]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,16 +37,16 @@ def write_attribute(attr_name, value)
|
|||||||
alias_method :raw_write_attribute, :write_attribute
|
alias_method :raw_write_attribute, :write_attribute
|
||||||
|
|
||||||
private
|
private
|
||||||
# Handle *= for method_missing.
|
# Handle *= for method_missing.
|
||||||
def attribute=(attribute_name, value)
|
def attribute=(attribute_name, value)
|
||||||
write_attribute(attribute_name, value)
|
write_attribute(attribute_name, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def type_cast_attribute_for_write(column, value)
|
def type_cast_attribute_for_write(column, value)
|
||||||
return value unless column
|
return value unless column
|
||||||
|
|
||||||
column.type_cast_for_write value
|
column.type_cast_for_write value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user