Class: GenerateMultipleRoomPlansWorker
- Inherits:
-
Object
- Object
- GenerateMultipleRoomPlansWorker
- Includes:
- Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/generate_multiple_room_plans_worker.rb
Overview
Sidekiq worker: generate multiple room plans.
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/workers/generate_multiple_room_plans_worker.rb', line 8 def perform() room_configuration_ids = [:room_configuration_ids] total room_configuration_ids.size current_step = 0 = "" room_configuration_ids.each do |room_configuration_id| rc = RoomConfiguration.find(room_configuration_id) current_step += 1 = "Refreshing plans for #{rc.reference_number}" at(current_step, ) rc.generate_all_plans end store redirect_to: [:on_finish_redirect_to] = "Successfully re-generated plans for #{room_configuration_ids.size} room(s)/area(s)." store message: end |