Class: Workarea::IndexCategorization

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.perform(category) ⇒ Object



11
12
13
14
15
16
17
# File 'app/workers/workarea/index_categorization.rb', line 11

def self.perform(category)
  Search::Storefront::Product.delete_category(category.id)

  return unless category.product_rules.present?

  Search::Storefront::Product.add_category(category)
end

Instance Method Details

#perform(id) ⇒ Object



19
20
21
22
# File 'app/workers/workarea/index_categorization.rb', line 19

def perform(id)
  category = Catalog::Category.find(id)
  self.class.perform(category)
end