Skip to content

Commit b3a759e

Browse files
pimpinclaude
andcommitted
Support ActiveSupport::TimeWithZone in serialize_for_binding
TimeWithZone does not inherit from Time or DateTime, so it was not being serialized to ISO8601. Use acts_like?(:time) duck-typing to handle all time-like objects from Rails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cafe88e commit b3a759e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/couchbase-orm/utilities/query_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module ClassMethods
77
def serialize_for_binding(value)
88
if value.is_a?(Array)
99
value.map { |v| serialize_for_binding(v) }
10-
elsif [DateTime, Time].any? { |clazz| value.is_a?(clazz) }
10+
elsif [DateTime, Time].any? { |clazz| value.is_a?(clazz) } || (value.respond_to?(:acts_like?) && value.acts_like?(:time))
1111
value.iso8601(@precision || 0)
1212
elsif value.is_a?(Date)
1313
value.to_s

0 commit comments

Comments
 (0)