Class: Cron::SwitchboardSyncModels

Inherits:
Job show all
Defined in:
lib/app/jobs/cron/switchboard_sync_models.rb

Overview

Cycle through all members and tell them to sync with with switchboard

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Job

cron_tab_entry, #send_support_email

Methods inherited from ApplicationJob

valid_environments

Methods included from App47Logger

clean_params, #clean_params, delete_parameter_keys, #log_controller_error, log_debug, #log_debug, log_error, #log_error, log_exception, #log_message, log_message, #log_warn, log_warn, mask_parameter_keys, #update_flash_messages

Class Method Details

.valid_environment?Boolean

Only run in environments where switchboard is configured

Returns:

  • (Boolean)


14
15
16
# File 'lib/app/jobs/cron/switchboard_sync_models.rb', line 14

def self.valid_environment?
  SystemConfiguration.switchboard_configured? && Web47core::Config.switchboard_able_models.present?
end

Instance Method Details

#performObject

Cycle through the collection and perform an upsert on it



21
22
23
# File 'lib/app/jobs/cron/switchboard_sync_models.rb', line 21

def perform
  Web47core::Config.switchboard_able_models.each { |model| model.each(&:switchboard_upsert) }
end