Sha256: abc9c255fa063beb11a5f677a59b66bb447e8fd44f16345fc805969ca461619e

Contents?: true

Size: 620 Bytes

Versions: 42

Compression:

Stored size: 620 Bytes

Contents

module CanvasSync
  module Jobs
    class SyncAdminsJob < CanvasSync::Job
      # Syncs Admins using the Canvas API
      #
      #
      # @param job_chain [Hash]
      # @param options [Hash]
      def perform(job_chain, _options)
        updated_admins = []
        CanvasSync.get_canvas_sync_client(job_chain[:global_options]).account_admins("self").all_pages!.each do |admin_params|
          admin = Admin.create_or_update(admin_params)
          updated_admins.push(admin.id)
        end
        Admin.where.not(id: updated_admins).delete_all
        CanvasSync.invoke_next(job_chain)
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
canvas_sync-0.10.6 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.10.5 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.10.4 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.10.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.10.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.10.0 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.9.4 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.9.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.9.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.9.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.9.0 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.8.4 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.8.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.8.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.8.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.8.0 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.7.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.7.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.7.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.7.0 lib/canvas_sync/jobs/sync_admins_job.rb