diff --git a/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb b/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb index 82232810..909b83d4 100644 --- a/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb +++ b/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb @@ -8,6 +8,7 @@ class DateTime < Type::DateTime # :nodoc: def serialize(value) value = super + return unless value return value.strftime('%Y-%m-%d %H:%M:%S') unless value.acts_like?(:time) value.to_time.strftime('%Y-%m-%d %H:%M:%S')