app/models/spotlight/resource.rb in blacklight-spotlight-0.20.3 vs app/models/spotlight/resource.rb in blacklight-spotlight-0.21.0
- old
+ new
@@ -47,11 +47,22 @@
update(enqueued_at: Time.zone.now)
super
end
def enqueued_at
- value = super
- Time.zone.parse(value) if value
+ if defined? ActiveModel::Type::DateTime
+ ActiveModel::Type::DateTime.new.cast(super)
+ else
+ ActiveRecord::Type::DateTime.new.type_cast_from_database(super)
+ end
+ end
+
+ def last_indexed_finished
+ if defined? ActiveModel::Type::DateTime
+ ActiveModel::Type::DateTime.new.cast(super)
+ else
+ ActiveRecord::Type::DateTime.new.type_cast_from_database(super)
+ end
end
def document_model
exhibit.blacklight_config.document_model if exhibit
end