Class: Maestrano::Connector::Rails::AllSynchronizationsJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/maestrano/connector/rails/all_synchronizations_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(name = nil, count = nil) ⇒ Object

Trigger synchronization of all active organizations



6
7
8
9
10
11
# File 'app/jobs/maestrano/connector/rails/all_synchronizations_job.rb', line 6

def perform(name=nil, count=nil)
  Maestrano::Connector::Rails::Organization.where("oauth_provider IS NOT NULL AND oauth_token IS NOT NULL").each do |o|
    next unless [true, 1].include?(o.sync_enabled)
    Maestrano::Connector::Rails::SynchronizationJob.perform_later(o, {})
  end
end