From 3e0ecde2082f3b0ca07e7b28cdd4f9294a223442 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 6 Feb 2012 15:52:16 -0800 Subject: adding a comment for myself --- activerecord/lib/active_record/attribute_methods.rb | 1 + .../lib/active_record/attribute_methods/write.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index a1e34a3aa1..889c80386f 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -194,6 +194,7 @@ module ActiveRecord # Returns the column object for the named attribute. 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] end diff --git a/activerecord/lib/active_record/attribute_methods/write.rb b/activerecord/lib/active_record/attribute_methods/write.rb index 310cd90433..6b0230384b 100644 --- a/activerecord/lib/active_record/attribute_methods/write.rb +++ b/activerecord/lib/active_record/attribute_methods/write.rb @@ -37,16 +37,16 @@ module ActiveRecord alias_method :raw_write_attribute, :write_attribute private - # Handle *= for method_missing. - def attribute=(attribute_name, value) - write_attribute(attribute_name, value) - end + # Handle *= for method_missing. + def attribute=(attribute_name, value) + write_attribute(attribute_name, value) + end - def type_cast_attribute_for_write(column, value) - return value unless column + def type_cast_attribute_for_write(column, value) + return value unless column - column.type_cast_for_write value - end + column.type_cast_for_write value + end end end end -- cgit v1.2.3