Skip to content

Commit 5660ddf

Browse files
committed
add tz to quoted date
1 parent 70afb4d commit 5660ddf

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

lib/active_record/connection_adapters/cockroachdb/quoting.rb

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

0 commit comments

Comments
 (0)