Class: ItemTranslationWorker
- Inherits:
-
Object
- Object
- ItemTranslationWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/item_translation_worker.rb
Overview
Sidekiq worker: item translation.
Instance Method Summary collapse
Instance Method Details
#perform(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/workers/item_translation_worker.rb', line 9 def perform( = {}) item_id = ['item_id'] locales = ['locales'].presence reset_previous_values = ['reset_previous_values'].to_b if item_id && (item = Item.find(item_id)) if ['specs'].to_b item.auto_translate_product_specifications(reset_previous_values: reset_previous_values, locales: locales) item.update_rendered_product_specifications end item.auto_translate_attributes(reset_previous_values: reset_previous_values, locales: locales) if ['attributes'].to_b end end |