Class: CompanyHolidaySyncWorker
- Inherits:
-
Object
- Object
- CompanyHolidaySyncWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/company_holiday_sync_worker.rb
Overview
Sidekiq worker: company holiday sync.
Instance Method Summary collapse
-
#perform(id, action = 'create') ⇒ Object
Sync a single company holiday to all employees of that country.
Instance Method Details
#perform(id, action = 'create') ⇒ Object
Sync a single company holiday to all employees of that country
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/workers/company_holiday_sync_worker.rb', line 11 def perform(id, action = 'create') holiday = CompanyHoliday.find_by(id: id) return unless holiday results = holiday.sync_to_all_employees(action) Rails.logger.info( "CompanyHolidaySyncWorker: Holiday '#{holiday.holiday_name}' (#{action}) - " \ "Synced: #{results[:synced]}, Skipped: #{results[:skipped]}, Failed: #{results[:failed]}" ) end |