canvas_sync 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d62d3319fd41f63dfadc619b59f28949b9e418f4017c0ca395ba98f62cea3a5
|
4
|
+
data.tar.gz: 789f76fc7c75a901a93e841fe1d883c635af40e1772191e30682e1837d92ca7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 373e4d1f08b87e585620625aa0fd15fd153fbd277b8ee81f195333a0fbc7e9e2b24aa558d63e06b9b71bbe9cbffa2f7f10f3a5b7c7a82f33566b515762356cc2
|
7
|
+
data.tar.gz: 856f8387e65df480460780a881d20764fce8dc7c78878940ba46f6b58cf6012be83cbb824c3cc5dd1c995b798a41b35492d9ab77c9194332a0748ace9dbca608
|
@@ -102,15 +102,24 @@ module CanvasSync
|
|
102
102
|
options = { validate: false, on_duplicate_key_update: update_conditions }.merge(import_args)
|
103
103
|
options.delete(:on_duplicate_key_update) if options.key?(:on_duplicate_key_ignore)
|
104
104
|
|
105
|
-
result =
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
result = nil
|
106
|
+
callback_env = {
|
107
|
+
batch: rows,
|
108
|
+
import_result: nil,
|
109
|
+
import_options: options,
|
110
110
|
}
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
ClassCallbackExecutor.run_if_defined(klass, :sync_batch_import, env: callback_env) do
|
112
|
+
result = klass.import(columns, rows, options)
|
113
|
+
callback_env[:import_result] = result
|
114
|
+
|
115
|
+
global_updates = {
|
116
|
+
canvas_synced_at: DateTime.now,
|
117
|
+
canvas_sync_batch_id: JobBatches::Batch.current_context[:sync_batch_id],
|
118
|
+
}
|
119
|
+
global_updates.slice!(*klass.column_names.map(&:to_sym))
|
120
|
+
if global_updates.present? && result.ids.present?
|
121
|
+
klass.where(id: result.ids).update_all(global_updates)
|
122
|
+
end
|
114
123
|
end
|
115
124
|
|
116
125
|
result
|
data/lib/canvas_sync/record.rb
CHANGED
data/lib/canvas_sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure CustomDev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|