Sha256: e6857ffbb9e9a201f27dbf239263e1512f29230c248ff32f09ff1a57622c87ef
Contents?: true
Size: 643 Bytes
Versions: 24
Compression:
Stored size: 643 Bytes
Contents
module Spotlight ## # Reindex the given resources or exhibits class ReindexJob < ActiveJob::Base queue_as :default before_enqueue do |job| resource_list(job.arguments.first).each(&:waiting!) end def perform(exhibit_or_resources) resource_list(exhibit_or_resources).each(&:reindex) end private def resource_list(exhibit_or_resources) if exhibit_or_resources.is_a?(Spotlight::Exhibit) exhibit_or_resources.resources.find_each elsif exhibit_or_resources.is_a?(Enumerable) exhibit_or_resources else Array(exhibit_or_resources) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems