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.6.4 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.6.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.6.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.6.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.6.0 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.5.4 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.5.3 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.5.2 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.5.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.4.1 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.4.0 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.23 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.22 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.21 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.20 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.19 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.18 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.17 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.16 lib/canvas_sync/jobs/sync_admins_job.rb
canvas_sync-0.3.15 lib/canvas_sync/jobs/sync_admins_job.rb