Class: ActiveRecord::ConnectionAdapters::Clickhouse::OID::Date

Inherits:
Type::Date
  • Object
show all
Defined in:
lib/active_record/connection_adapters/clickhouse/oid/date.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#type_cast_for_schema(value) ⇒ Object

Type cast a value for schema dumping. This method is private, as we are hoping to remove it entirely.



15
16
17
18
19
20
21
22
# File 'lib/active_record/connection_adapters/clickhouse/oid/date.rb', line 15

def type_cast_for_schema(value) # :nodoc:
  case value
    when 'toDate(now()', 'CAST(now() AS Date)'
      'now()'.inspect
    else
      value.inspect
  end
end

#type_cast_from_database(value) ⇒ Object



9
10
11
# File 'lib/active_record/connection_adapters/clickhouse/oid/date.rb', line 9

def type_cast_from_database(value)
  value
end