Class: ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlJson

Inherits:
Type::Internal::AbstractJson show all
Defined in:
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from ActiveModel::Type::Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods inherited from Type::Internal::AbstractJson

#accessor, #deserialize, #serialize, #type

Methods included from ActiveModel::Type::Helpers::Mutable

#cast

Methods inherited from ActiveModel::Type::Value

#==, #assert_valid_value, #binary?, #cast, #changed?, #deserialize, #hash, #initialize, #map, #serialize, #type, #type_cast_for_schema

Constructor Details

This class inherits a constructor from ActiveModel::Type::Value

Instance Method Details

#changed_in_place?(raw_old_value, new_value) ⇒ Boolean

Returns:

  • (Boolean)

943
944
945
946
947
# File 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb', line 943

def changed_in_place?(raw_old_value, new_value)
  # Normalization is required because MySQL JSON data format includes
  # the space between the elements.
  super(serialize(deserialize(raw_old_value)), new_value)
end