class ActiveModel::Type::Value

def cast(value)

+value+ The raw input, as provided to the attribute setter.

Value#cast_value.
ActiveRecord::AttributeMethods::Read#read_attribute. See also:
The return value of this method will be returned from

from.
There is currently no way to differentiate between which source it came
be a string from the form builder, or a ruby object passed to a setter.
Type casts a value from user input (e.g. from a setter). This value may
def cast(value)
  cast_value(value) unless value.nil?
end