Class: Cron::SwitchboardSyncModels
- Inherits:
- 
      Job
      
        - Object
- ActiveJob::Base
- ApplicationJob
- Job
- Cron::SwitchboardSyncModels
 
- 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
- 
  
    
      .valid_environment?  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Only run in environments where switchboard is configured. 
Instance Method Summary collapse
- 
  
    
      #perform  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Cycle through the collection and perform an upsert on it. 
Methods inherited from Job
cron_tab_entry, #send_support_email
Methods inherited from ApplicationJob
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
| 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
#perform ⇒ Object
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 |