123456789_123456789_123456789_123456789_123456789_

Class: ActiveModel::Attribute::FromUser

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveModel::Attribute
Defined in: activemodel/lib/active_model/attribute.rb

Class Method Summary

::ActiveModel::Attribute - Inherited

.from_database, .from_user,
.new

This method should not be called directly.

.null, .uninitialized, .with_cast_value

Instance Attribute Summary

Instance Method Summary

Constructor Details

This class inherits a constructor from ActiveModel::Attribute

Instance Attribute Details

#came_from_user?Boolean (readonly)

[ GitHub ]

  
# File 'activemodel/lib/active_model/attribute.rb', line 202

def came_from_user?
  !type.value_constructed_by_mass_assignment?(value_before_type_cast)
end

Instance Method Details

#_value_for_database (private)

[ GitHub ]

  
# File 'activemodel/lib/active_model/attribute.rb', line 207

def _value_for_database
  Type::SerializeCastValue.serialize(type, value)
end

#type_cast(value)

[ GitHub ]

  
# File 'activemodel/lib/active_model/attribute.rb', line 198

def type_cast(value)
  type.cast(value)
end