def write_attribute(name, value)
      name = name.to_sym

      if association = @associations[name]
        association.reset
      end

      @attributes_before_type_cast[name] = value

      value_casted = TypeCasting.cast_field(value, self.class.attributes[name])
      attributes[name] = value_casted
    end
def write_attribute(name, value)
      name = name.to_sym

      if association = @associations[name]
        association.reset
      end

      @attributes_before_type_cast[name] = value

      value_casted = TypeCasting.cast_field(value, self.class.attributes[name])
      attributes[name] = value_casted
    end
Write an attribute on the object. Also marks the previous value as dirty.

 @param [Symbol] name the name of the field
 @param [Object] value the value to assign to that field

 @since 0.2.0