Updates the attribute identified by attr_name with the specified value. Empty strings for fixnum and float columns are turned into nil.
# File lib/active_record/attribute_methods/write.rb, line 19 19: def write_attribute(attr_name, value) 20: attr_name = attr_name.to_s 21: attr_name = self.class.primary_key if attr_name == 'id' 22: @attributes_cache.delete(attr_name) 23: if (column = column_for_attribute(attr_name)) && column.number? 24: @attributes[attr_name] = convert_number_column_value(value) 25: else 26: @attributes[attr_name] = value 27: end 28: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.