Sha256: aaaf7a16094b2c95c9e8c6c9064355fc4fd067e947be668b75d1cfaa9ef7bcb3
Contents?: true
Size: 1.14 KB
Versions: 72
Compression:
Stored size: 1.14 KB
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 options [Hash] If options contains a :term_scope a seperate provisioning report # will be started for each term in that scope. :models should be an array of # models to sync. def perform(options) CanvasSync.get_canvas_sync_client(batch_context).terms("self", workflow_state: ['all']).all_pages!.each do |term_params| if account_id = batch_context[:account_id] # These branches are primarily to support Legacy apps if Term.respond_to?(:create_or_update) && Term.method(:create_or_update).arity.abs == 2 Term.create_or_update(term_params, account_id) else term_params[:account_id] |= account_id update_or_create_model(Term, term_params) end else update_or_create_model(Term, term_params) end end TermBatchesJob.perform_now(options) end end end end
Version data entries
72 entries across 72 versions & 1 rubygems