Skip to content

Commit cfb84ba

Browse files
committed
Use 0 as default precision
Since Time has been rewritten in C in Ruby 3.4
1 parent efee2f6 commit cfb84ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/couchbase-orm/types/date_time.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ def cast(value)
77
end
88

99
def serialize(value)
10-
value&.iso8601(@precision)
10+
value&.
11+
iso8601(@precision || 0)
1112
end
1213
end
1314
end

lib/couchbase-orm/utilities/query_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def quote(value)
133133
if [String, Date].any? { |clazz| value.is_a?(clazz) }
134134
"'#{N1ql.sanitize(value)}'"
135135
elsif [DateTime, Time].any? { |clazz| value.is_a?(clazz) }
136-
formatedDate = value&.iso8601(@precision)
136+
formatedDate = value&.iso8601(@precision || 0)
137137
"'#{N1ql.sanitize(formatedDate)}'"
138138
elsif value.is_a? Array
139139
"[#{value.map{|v|quote(v)}.join(', ')}]"

0 commit comments

Comments
 (0)