Class: Spotlight::Resources::Upload
Overview
Exhibit-specific resources, created using uploaded and custom fields
Class Method Summary
collapse
Instance Method Summary
collapse
#document_model, #reindex_later, #save_and_index
Class Method Details
.fields(exhibit) ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/models/spotlight/resources/upload.rb', line 14
def self.fields(exhibit)
@fields ||= {}
@fields[exhibit] ||= begin
title_field = Spotlight::Engine.config.upload_title_field || OpenStruct.new(field_name: exhibit.blacklight_config.index.title_field)
[title_field] + exhibit.uploaded_resource_fields
end
end
|
Instance Method Details
#compound_id ⇒ Object
22
23
24
|
# File 'app/models/spotlight/resources/upload.rb', line 22
def compound_id
"#{exhibit_id}-#{id}"
end
|
#sidecar ⇒ Object
26
27
28
|
# File 'app/models/spotlight/resources/upload.rb', line 26
def sidecar
@sidecar ||= document_model.new(id: compound_id).sidecar(exhibit)
end
|