app/models/concerns/blacklight/document.rb in blacklight-7.31.0 vs app/models/concerns/blacklight/document.rb in blacklight-7.32.0
- old
+ new
@@ -24,10 +24,12 @@
included do
extend ActiveModel::Naming
include Blacklight::Document::Extensions
include GlobalID::Identification
+
+ class_attribute :inspector_fields, default: [:_source]
end
attr_reader :response, :_source
alias_method :solr_response, :response
@@ -78,9 +80,14 @@
end
end
def first key
Array(self[key]).first
+ end
+
+ def inspect
+ fields = inspector_fields.map { |field| "#{field}: #{public_send(field)}" }.join(", ")
+ "#<#{self.class.name}:#{object_id} #{fields}>"
end
def to_partial_path
'catalog/document'
end