module ActiveModel::Type::SerializeCastValue::ClassMethods

def serialize_cast_value_compatible?

def serialize_cast_value_compatible?
  return @serialize_cast_value_compatible if defined?(@serialize_cast_value_compatible)
  @serialize_cast_value_compatible = ancestors.index(instance_method(:serialize_cast_value).owner) <= ancestors.index(instance_method(:serialize).owner)
end