Class: ActiveRecord::ConnectionAdapters::CipherStashPG::OID::Date
- Inherits:
-
Type::Date
- Object
- Type::Date
- ActiveRecord::ConnectionAdapters::CipherStashPG::OID::Date
- Defined in:
- lib/active_record/connection_adapters/6.1/cipherstash_pg/oid/date.rb,
lib/active_record/connection_adapters/7.0/cipherstash_pg/oid/date.rb,
lib/active_record/connection_adapters/7.1/cipherstash_pg/oid/date.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#cast_value(value) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_record/connection_adapters/6.1/cipherstash_pg/oid/date.rb', line 8 def cast_value(value) case value when "infinity" then ::Float::INFINITY when "-infinity" then -::Float::INFINITY when / BC$/ value = value.sub(/^\d+/) { |year| format("%04d", -year.to_i + 1) } super(value.delete_suffix!(" BC")) else super end end |
#type_cast_for_schema(value) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/active_record/connection_adapters/7.0/cipherstash_pg/oid/date.rb', line 20 def type_cast_for_schema(value) case value when ::Float::INFINITY then "::Float::INFINITY" when -::Float::INFINITY then "-::Float::INFINITY" else super end end |