Skip to content

Commit

Permalink
Ensuring that IIIFResources are not created within the Rake Task pome…
Browse files Browse the repository at this point in the history
…granate:reindex and ensuring that SolrDocumentSidecars are reindexed after they are updated in pomegranate:sidecar_clean_references
  • Loading branch information
jrgriffiniii committed Feb 19, 2019
1 parent b02a7ed commit dfcfa1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if Rails.env.development? || Rails.env.test?
manifest = args[:manifest]
exhibit_slug = args[:exhibit]
exhibit = Spotlight::Exhibit.find_by(slug: exhibit_slug)
iiif_resource = IIIFResource.find_or_initialize_by(url: manifest, exhibit: exhibit)
iiif_resource = IIIFResource.find_by(url: manifest, exhibit: exhibit)
iiif_resource.save_and_index_now
puts "Reindexed the document for #{manifest}"
end
Expand All @@ -26,6 +26,7 @@ if Rails.env.development? || Rails.env.test?
next unless sidecar.data != valid_data
sidecar.data = valid_data
sidecar.save
sidecar.resource.reindex_later
puts "Updated the SolrDocumentSidecar for #{sidecar.document_id}"
end
end
Expand Down

0 comments on commit dfcfa1d

Please sign in to comment.