Sha256: 51d4982e9e3e3350960046dcd73e3458c10d51e5dababd19d0c9497fb583ea37

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 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

5 entries across 5 versions & 1 rubygems

Version Path
web47core-0.1.11 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.10 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.9 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.8 lib/app/jobs/cron/switchboard_sync_models.rb
web47core-0.1.7 lib/app/jobs/cron/switchboard_sync_models.rb