Files

Class Index [+]

Quicksearch

ActiveRecord::AttributeMethods::Write

Public Instance Methods

write_attribute(attr_name, value) click to toggle source

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

Private Instance Methods

attribute=(attribute_name, value) click to toggle source

Handle *= for method_missing.

    # File lib/active_record/attribute_methods/write.rb, line 32
32:         def attribute=(attribute_name, value)
33:           write_attribute(attribute_name, value)
34:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.