module T::Enum::LegacyMigrationMode

def ==(other)

def ==(other)
  case other
  when String
    if T::Configuration.legacy_t_enum_migration_mode?
      comparison_assertion_failed(:==, other)
      self.serialize == other
    else
      false
    end
  else
    super(other)
  end
end

def ===(other)

def ===(other)
  case other
  when String
    if T::Configuration.legacy_t_enum_migration_mode?
      comparison_assertion_failed(:===, other)
      self.serialize == other
    else
      false
    end
  else
    super(other)
  end
end

def comparison_assertion_failed(method, other)

def comparison_assertion_failed(method, other)
figuration.soft_assert_handler(
m to string comparison not allowed. Compare to the Enum instance directly instead. See go/enum-migration',
ytime: {
ass: self.class.name,
lf: self.inspect,
her: other,
her_class: other.class.name,
thod: method,
ller_location: Kernel.caller_locations(2..2)&.[](0)&.then {"#{_1.path}:#{_1.lineno}"},

def serialize; end

def serialize; end