Module: ActiveRecord::ConnectionAdapters::Quoting

Defined in:
lib/activerecord-not_nil/active_record/connection_adapters/quoting.rb

Instance Method Summary collapse

Instance Method Details

#origin_type_castObject



6
# File 'lib/activerecord-not_nil/active_record/connection_adapters/quoting.rb', line 6

alias origin_type_cast type_cast

#type_cast(value) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
# File 'lib/activerecord-not_nil/active_record/connection_adapters/quoting.rb', line 7

def type_cast(value)
  raise ArgumentError, 'Cannot assign not_nil as a value' if value.is_a?(::NotNilClass)

  origin_type_cast(value)
end