Flowdock
method

write_attribute_with_type_cast

Importance_0
v4.2.9 - Show latest stable - 0 notes - Class: ActiveRecord::AttributeMethods::Write
write_attribute_with_type_cast(attr_name, value, should_type_cast) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/attribute_methods/write.rb, line 69
      def write_attribute_with_type_cast(attr_name, value, should_type_cast)
        attr_name = attr_name.to_s
        attr_name = self.class.primary_key if attr_name == 'id' && self.class.primary_key

        if should_type_cast
          @attributes.write_from_user(attr_name, value)
        else
          @attributes.write_cast_value(attr_name, value)
        end

        value
      end
Register or log in to add new notes.