canvas_sync 0.18.9 → 0.18.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_sync/concerns/ability_helper.rb +1 -1
- data/lib/canvas_sync/job_batches/chain_builder.rb +4 -0
- data/lib/canvas_sync/version.rb +1 -1
- data/lib/canvas_sync.rb +7 -4
- data/spec/dummy/log/test.log +2066 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 911b4fffbc2c21c25f32b45c0c90419dddcef40497b63c5d5757ec0e12544e36
|
4
|
+
data.tar.gz: 90377a8facd25b77726ab82754a50c7aa3a9851c1012801496e19d6258ea7275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5186a70509b324acdd5e8a8e023fdfb9503b7e899894938944632759eeb0bf362cd467f30700f3d8ba02a0ee06476c7646b83acf34ea3eeae5d0375a518d1096
|
7
|
+
data.tar.gz: 11812e324c87f8055baaade4a36a822b090b66c95691521a32eb89855c51ceddeaee417f87aae9f5b5c5401c1fe3a6433d102b4a5d9948f5278835ce71f8530d
|
@@ -21,7 +21,7 @@ module CanvasSync::Concerns
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def get_lti_cust_param(key)
|
24
|
-
nkey = key.gsub(/^custom_/, '')
|
24
|
+
nkey = key.to_s.gsub(/^custom_/, '')
|
25
25
|
|
26
26
|
launch_params.dig("https://purl.imsglobal.org/spec/lti/claim/custom", nkey) || launch_params[nkey] || launch_params["custom_#{nkey}"]
|
27
27
|
end
|
@@ -98,6 +98,10 @@ module CanvasSync
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
def empty?
|
102
|
+
self.class.get_chain_parameter(self).empty?
|
103
|
+
end
|
104
|
+
|
101
105
|
def get_sub_chain(sub_type)
|
102
106
|
matching_jobs = find_matching_jobs(sub_type).to_a
|
103
107
|
raise "Found multiple \"#{sub_type}\" jobs in the chain" if matching_jobs.count > 1
|
data/lib/canvas_sync/version.rb
CHANGED
data/lib/canvas_sync.rb
CHANGED
@@ -170,9 +170,6 @@ module CanvasSync
|
|
170
170
|
# General provisioning jobs (not term-scoped)
|
171
171
|
##############################
|
172
172
|
|
173
|
-
# Terms are always synced regardless of the models option
|
174
|
-
models -= ['terms']
|
175
|
-
|
176
173
|
# Accounts, users, roles, and admins cannot be scoped to term
|
177
174
|
try_add_model_job.call('accounts')
|
178
175
|
|
@@ -194,9 +191,10 @@ module CanvasSync
|
|
194
191
|
# Per-term provisioning jobs
|
195
192
|
###############################
|
196
193
|
|
194
|
+
term_parent_chain = current_chain
|
195
|
+
|
197
196
|
per_term_chain = JobBatches::ChainBuilder.new(model_job_map[:terms])
|
198
197
|
per_term_chain.params[:term_scope] = term_scope
|
199
|
-
current_chain << per_term_chain
|
200
198
|
current_chain = per_term_chain
|
201
199
|
|
202
200
|
term_scoped_models.each do |mdl|
|
@@ -207,6 +205,11 @@ module CanvasSync
|
|
207
205
|
generate_provisioning_jobs(models, options)
|
208
206
|
)
|
209
207
|
|
208
|
+
# Skip syncing terms if not required
|
209
|
+
unless current_chain.empty? || (models & ['terms']).present?
|
210
|
+
term_parent_chain << per_term_chain
|
211
|
+
end
|
212
|
+
|
210
213
|
###############################
|
211
214
|
# Wrap it all up
|
212
215
|
###############################
|