File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,6 @@ def self.lookup_type(type)
132
132
if type == :datetime || type == :time
133
133
lookup_kwargs [ :precision ] = ActiveSupport ::JSON ::Encoding . time_precision
134
134
end
135
-
136
135
type = ActiveRecord ::Type . lookup ( type , **lookup_kwargs )
137
136
elsif !( type . is_a? ( ActiveModel ::Type ::Value ) || type . is_a? ( ActiveRecord ::AttributeMethods ::TimeZoneConversion ::TimeZoneConverter ) )
138
137
raise ArgumentError , "Second argument (#{ type } ) must be a symbol or instance of an ActiveModel::Type::Value subclass"
Original file line number Diff line number Diff line change @@ -242,13 +242,17 @@ def cast(value) ; value ; end
242
242
243
243
it "can define without triggering a db connection" do
244
244
expect ( ActiveRecord ::Base ) . not_to receive ( :connection )
245
+ expect ( ActiveRecord ::Type ) . not_to receive ( :adapter_name_from )
245
246
246
247
Class . new ( ActiveRecord ::Base ) do
247
248
include AttrJson ::Record
248
249
249
250
self . table_name = "products"
250
251
attr_json :value , :string
252
+ attr_json :datetime_value , :datetime
253
+ attr_json :time_value , :time
251
254
end
255
+
252
256
end
253
257
254
258
it "has registered attributes on registry" do
You can’t perform that action at this time.
0 commit comments