Sha256: 0dd91964efdda6f345c3caa07caf0d1c097213c42fed15f21455f8ea438bd9c9

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

#
# Run in cron
#
module Cron
  #
  # Cycle through all members and tell them to sync with with switchboard
  #
  class SwitchboardSyncModels <Job
    cron_tab_entry :daily

    #
    # Only run in environments where switchboard is configured
    #
    def self.valid_environment?
      SystemConfiguration.switchboard_configured? && Web47core.config.switchboard_able_models.present?
    end

    #
    # Cycle through the collection and perform an upsert on it
    #
    def perform
      Web47core.config.switchboard_able_models.each { |model| model.each(&:switchboard_upsert) }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
web47core-0.1.6 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.5 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.4 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.3 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.2 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.1 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.0 lib/app/jobs/cron/switchboard_sync_models.rb