class ActiveModel::Type::String

check if a string has changed.
However, it accounts for mutable strings, so dirty tracking can properly
performs coercion in the same way, and can be configured in the same way.
This class is a specialization of ActiveModel::Type::ImmutableString. It
Attribute type for strings. It is registered under the :string key.
= Active Model String Type

def cast_value(value)

def cast_value(value)
  case value
  when ::String then ::String.new(value)
  when true then @true
  when false then @false
  else value.to_s
  end
end

def changed_in_place?(raw_old_value, new_value)

def changed_in_place?(raw_old_value, new_value)
  if new_value.is_a?(::String)
    raw_old_value != new_value
  end
end

def to_immutable_string

def to_immutable_string
  ImmutableString.new(
    true: @true,
    false: @false,
    limit: limit,
    precision: precision,
    scale: scale,
  )
end