Sha256: 1e84d06b16c51f1f260c03bad37a721083267132e8b607a0324108c9a1ffd274

Contents?: true

Size: 729 Bytes

Versions: 42

Compression:

Stored size: 729 Bytes

Contents

module CanvasSync
  module Jobs
    class SyncTermsJob < CanvasSync::Job
      # Syncs Terms using the Canvas API
      #
      # Terms are pre-synced so that provisioning reports can be scoped to term.
      #
      # @param job_chain [Hash]
      # @param options [Hash]
      def perform(job_chain, _options)
        CanvasSync.get_canvas_sync_client(job_chain[:global_options]).terms("self").all_pages!.each do |term_params|
          if job_chain[:global_options][:account_id]
            Term.create_or_update(term_params, job_chain[:global_options][:account_id])
          else
            Term.create_or_update(term_params)
          end
        end

        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_terms_job.rb
canvas_sync-0.10.5 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.10.4 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.10.3 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.10.2 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.10.0 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.9.4 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.9.3 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.9.2 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.9.1 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.9.0 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.8.4 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.8.3 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.8.2 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.8.1 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.8.0 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.7.3 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.7.2 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.7.1 lib/canvas_sync/jobs/sync_terms_job.rb
canvas_sync-0.7.0 lib/canvas_sync/jobs/sync_terms_job.rb