Class: Workarea::IndexPage

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::CallbacksWorker, Sidekiq::Worker
Defined in:
app/workers/workarea/index_page.rb

Instance Method Summary collapse

Instance Method Details

#perform(id) ⇒ Object



12
13
14
15
16
17
18
19
# File 'app/workers/workarea/index_page.rb', line 12

def perform(id)
  page = Content::Page.find(id)
  Search::Storefront::Page.new(page).save
rescue Mongoid::Errors::DocumentNotFound
  Search::Storefront::Page.new(
    Content::Page.new(id: id)
  ).destroy
end