canvas_sync 0.17.41 → 0.17.43
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/engine.rb +9 -6
- data/lib/canvas_sync/jobs/begin_sync_chain_job.rb +5 -1
- data/lib/canvas_sync/jobs/report_processor_job.rb +1 -1
- data/lib/canvas_sync/jobs/report_starter.rb +5 -1
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/dummy/log/test.log +2066 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d7516d1ed3059c0c62d1f1ac058841dd289aca1ff8007576be2b0d823def9b7
|
4
|
+
data.tar.gz: 39fc2b3ade4599edaec6282b1db7b45f8cb81817573d7f35e7de1377624b1474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0978316cfc1c66f2411d1fe00b3c9375a4032b8b6be49d63807fb596bc07f25367fe013e3e5bbba32085e0ebf9a4bfcd977c19c5e20a11c41bf02de0da40bd2a'
|
7
|
+
data.tar.gz: 7496829655356548947c2782a024c76370f9d1f74ac6b96b17d2df2c4afd177f5e43be6d0b60b1cee79955e15ba5a387e002c784bcc0dde2ee48b3bae7f61783
|
data/lib/canvas_sync/engine.rb
CHANGED
@@ -8,6 +8,7 @@ module CanvasSync
|
|
8
8
|
initializer "canvas_sync.safe_yaml_classes" do |app|
|
9
9
|
app.config.active_record.yaml_column_permitted_classes ||= []
|
10
10
|
app.config.active_record.yaml_column_permitted_classes |= [Symbol, ActiveSupport::HashWithIndifferentAccess]
|
11
|
+
ActiveRecord::Base.yaml_column_permitted_classes |= app.config.active_record.yaml_column_permitted_classes
|
11
12
|
rescue
|
12
13
|
end
|
13
14
|
|
@@ -40,12 +41,14 @@ module CanvasSync
|
|
40
41
|
|
41
42
|
require 'panda_pal'
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
class ::Object
|
45
|
+
def canvas_sync_client(account_id = nil)
|
46
|
+
Bearcat::Client.new(
|
47
|
+
prefix: current_organization.canvas_url,
|
48
|
+
token: current_organization.canvas_api_token,
|
49
|
+
master_rate_limit: (Rails.env.production? && !!defined?(Redis) && ENV['REDIS_URL'].present?),
|
50
|
+
)
|
51
|
+
end
|
49
52
|
end
|
50
53
|
rescue LoadError
|
51
54
|
end
|
@@ -6,12 +6,16 @@ module CanvasSync
|
|
6
6
|
def perform(chain_definition, globals = {})
|
7
7
|
@globals = globals
|
8
8
|
|
9
|
+
if globals[:updated_after] == nil && Rails.env.development?
|
10
|
+
globals[:updated_after] = false
|
11
|
+
end
|
12
|
+
|
9
13
|
if globals[:updated_after] == false
|
10
14
|
globals[:updated_after] = nil
|
11
15
|
elsif !globals[:updated_after].present? || globals[:updated_after] == true
|
12
16
|
last_batch = SyncBatch.where(status: 'completed', batch_genre: genre).last
|
13
17
|
globals[:full_sync_every] ||= "sunday/2"
|
14
|
-
globals[:updated_after] = last_batch
|
18
|
+
globals[:updated_after] = ((last_batch.started_at - 1.day).iso8601 rescue nil)
|
15
19
|
end
|
16
20
|
|
17
21
|
# Refuse to run syncs of the same genre if there is a running full sync
|
@@ -35,7 +35,11 @@ module CanvasSync
|
|
35
35
|
|
36
36
|
protected
|
37
37
|
|
38
|
-
|
38
|
+
# Ruby 3 changed how kwargs are handled. _kw_placeholder allows for backwards compatibility
|
39
|
+
# In Ruby 2, merge_report_params(options, params) would parse as merge_report_params(options, params={}, **params) (wtf?), so
|
40
|
+
# merge_report_params(options, params, {}) is used. That doesn't work in Ruby 3.
|
41
|
+
# In order to maintain compatibility with 2 and with any apps, this oddness is needed
|
42
|
+
def merge_report_params(options, params={}, _kw_placeholder=nil, term_scope: true)
|
39
43
|
term_scope = options[:canvas_term_id] || batch_context[:canvas_term_id] if term_scope == true
|
40
44
|
if term_scope.present?
|
41
45
|
params[:enrollment_term_id] = term_scope
|
data/lib/canvas_sync/version.rb
CHANGED