Sha256: 9dd7d66004b1c1fa1798ff4c0ca5ac23dbae5a20b0948f9e17f83e93c8e3fcf2

Contents?: true

Size: 605 Bytes

Versions: 42

Compression:

Stored size: 605 Bytes

Contents

module CanvasSync
  module Jobs
    class SyncRolesJob < CanvasSync::Job
      # Syncs Roles using the Canvas API
      #
      #
      # @param job_chain [Hash]
      # @param options [Hash]
      def perform(job_chain, _options)
        updated_roles = []
        CanvasSync.get_canvas_sync_client(job_chain[:global_options]).list_roles("self").all_pages!.each do |role_params|
          role = Role.create_or_update(role_params)
          updated_roles.push(role.id)
        end
        Role.where.not(id: updated_roles).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_roles_job.rb
canvas_sync-0.10.5 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.10.4 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.10.3 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.10.2 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.10.0 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.9.4 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.9.3 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.9.2 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.9.1 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.9.0 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.8.4 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.8.3 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.8.2 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.8.1 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.8.0 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.7.3 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.7.2 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.7.1 lib/canvas_sync/jobs/sync_roles_job.rb
canvas_sync-0.7.0 lib/canvas_sync/jobs/sync_roles_job.rb