Skip to content

Commit bec29c4

Browse files
committed
datetime and time types should still use nil adapter
1 parent 115c399 commit bec29c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/attr_json/attribute_definition.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def self.lookup_type(type)
130130
# serializing, we're kind of stuck with this precision in current implementation.
131131
lookup_kwargs = { adapter: nil }
132132
if type == :datetime || type == :time
133-
lookup_kwargs = { precision: ActiveSupport::JSON::Encoding.time_precision }
133+
lookup_kwargs[:precision] = ActiveSupport::JSON::Encoding.time_precision
134134
end
135135

136136
type = ActiveRecord::Type.lookup(type, **lookup_kwargs)

0 commit comments

Comments
 (0)