Skip to content

Commit 86d6fdb

Browse files
committed
add tz to quoted date
1 parent 70afb4d commit 86d6fdb

File tree

1 file changed

+9
-0
lines changed
  • lib/active_record/connection_adapters/cockroachdb

1 file changed

+9
-0
lines changed

lib/active_record/connection_adapters/cockroachdb/quoting.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ def quote(value)
5050
super
5151
end
5252
end
53+
54+
def quoted_date(value)
55+
puts "quoted_date(value=#{value}) #{value.class}"
56+
# CockroachDB differs from PostgreSQL in its representation of
57+
# a `timestamp with timezone`, it does not always include the
58+
# timezone offset (e.g. `+00`), so we need to add it here.
59+
# This is tested by `BasicsTest#test_default_in_local_time`.
60+
super + value.strftime("%z")
61+
end
5362
end
5463
end
5564
end

0 commit comments

Comments
 (0)