canvas_sync 0.19.0.beta10 → 0.19.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/canvas_sync/concerns/ability_helper.rb +16 -144
  3. data/lib/canvas_sync/concerns/account/ancestry.rb +1 -1
  4. data/lib/canvas_sync/concerns/api_syncable.rb +1 -1
  5. data/lib/canvas_sync/generators/templates/migrations/create_course_nicknames.rb +17 -0
  6. data/lib/canvas_sync/generators/templates/models/course_nickname.rb +13 -0
  7. data/lib/canvas_sync/processors/model_mappings.yml +18 -0
  8. data/lib/canvas_sync/processors/provisioning_report_processor.rb +10 -0
  9. data/lib/canvas_sync/record.rb +1 -1
  10. data/lib/canvas_sync/version.rb +1 -1
  11. data/lib/canvas_sync.rb +1 -0
  12. data/spec/canvas_sync/processors/provisioning_report_processor_spec.rb +9 -0
  13. data/spec/dummy/app/models/account.rb +2 -0
  14. data/spec/dummy/app/models/admin.rb +2 -0
  15. data/spec/dummy/app/models/assignment.rb +2 -0
  16. data/spec/dummy/app/models/assignment_group.rb +2 -0
  17. data/spec/dummy/app/models/content_migration.rb +2 -0
  18. data/spec/dummy/app/models/context_module.rb +2 -0
  19. data/spec/dummy/app/models/context_module_item.rb +2 -0
  20. data/spec/dummy/app/models/course.rb +2 -0
  21. data/spec/dummy/app/models/course_nickname.rb +19 -0
  22. data/spec/dummy/app/models/enrollment.rb +2 -0
  23. data/spec/dummy/app/models/grading_period.rb +2 -0
  24. data/spec/dummy/app/models/grading_period_group.rb +2 -0
  25. data/spec/dummy/app/models/group.rb +2 -0
  26. data/spec/dummy/app/models/group_membership.rb +2 -0
  27. data/spec/dummy/app/models/learning_outcome.rb +2 -0
  28. data/spec/dummy/app/models/pseudonym.rb +2 -0
  29. data/spec/dummy/app/models/role.rb +2 -0
  30. data/spec/dummy/app/models/section.rb +2 -0
  31. data/spec/dummy/app/models/submission.rb +2 -0
  32. data/spec/dummy/app/models/term.rb +2 -0
  33. data/spec/dummy/app/models/user.rb +2 -0
  34. data/spec/dummy/app/models/user_observer.rb +2 -0
  35. data/spec/dummy/db/migrate/20240408223326_create_course_nicknames.rb +23 -0
  36. data/spec/dummy/db/schema.rb +12 -1
  37. data/spec/support/fixtures/reports/course_nicknames.csv +3 -0
  38. metadata +170 -163
  39. data/lib/canvas_sync/concerns/auto_relations.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cd64554a1f451160b874e8901b7275a25b6f9c526d687a29e531abff9f0b285
4
- data.tar.gz: 9cac31449a633b4c3513088abf00b0274b0ce794e54f72742d65802bf2bb5a8c
3
+ metadata.gz: 04535c6dcbf7a70c8214d3f6675fa9073fc69490d07c69f6723aac7667d921af
4
+ data.tar.gz: 19b2b70f666782f9c245dd2d7834031ee0630801d24b3c40ca9f5e219bbc6e07
5
5
  SHA512:
6
- metadata.gz: a479a1705e765b3e338c7aed688728436fbeedd82809218bcbd288775e9a2175c62d5294dc2a206fdb77a7945f0223be723b74e9ec6800635841124e42149c22
7
- data.tar.gz: 96bef245b0ba1a4de671dfc1d49a184d35bd03fea62efad44dbaac1bdcff345cabd19b1f12147f1d334b967641ce72e9c66704e0709f55b5f2378475d39d9d86
6
+ metadata.gz: 5f4028ae4b48d654eb97ead31f5fd608c3f786de9c205ed0939cc2bb4ea8845011c2089de96876b811f0723475905959bf605e00e43f9bd5dedda8679f780dce
7
+ data.tar.gz: cd8b2f0ea274ae2d8c9cb73a0329cd780cb9336f8fa73eb5584f5dcb7e7c5fa659cba38d4d2d6071f57d5744f1a18902631057c958e4db5acb57a43757e5043b
@@ -1,171 +1,43 @@
1
1
  module CanvasSync::Concerns
2
2
  module AbilityHelper
3
3
  extend ActiveSupport::Concern
4
+ include PandaPal::Concerns::AbilityHelper if defined?(PandaPal::Concerns::AbilityHelper)
4
5
 
5
- # PandaPal Domain
6
-
7
- def panda_pal_session
8
- @panda_pal_session ||= @controller.current_session&.data || {}
9
- end
10
-
11
- def rails_session
12
- @rails_session ||= @controller.session
13
- end
14
-
15
- def is_lti_launch?
16
- panda_pal_session.present?
17
- end
18
-
19
- def launch_params
20
- @launch_params ||= panda_pal_session[:launch_params] || {}
21
- end
22
-
23
- def get_lti_cust_param(key)
24
- nkey = key.to_s.gsub(/^custom_/, '')
25
-
26
- launch_params.dig("https://purl.imsglobal.org/spec/lti/claim/custom", nkey) || launch_params[nkey] || launch_params["custom_#{nkey}"]
27
- end
28
-
29
- def lti_launch_placement
30
- launch_params['https://www.instructure.com/placement'] || launch_params[:launch_type]
31
- end
32
-
33
- def canvas_role_labels
34
- labels = get_lti_cust_param('custom_canvas_role')
35
- labels.is_a?(String) ? labels.split(',') : []
36
- end
37
-
38
- def canvas_account_role_labels(account = 'self')
39
- account = 'self' if account.to_s == "root"
40
- account = account.canvas_id if account.respond_to?(:canvas_id)
41
-
42
- if "::Admin".safe_constantize && ::Admin < ::ActiveRecord::Base
43
- account = current_organization.canvas_account_id if account == 'self'
44
- adm_query = ::Admin.where(canvas_account_id: account, workflow_state: "active")
45
- adm_query.pluck(:role_name)
46
- else
47
- Rails.cache.fetch([self.class.name, "AccountAdminLinks", account, canvas_user_id], expires_in: 1.hour) do
48
- admin_entries = canvas_sync_client.account_admins(account, user_id: [canvas_user_id])
49
- admin_entries = admin_entries.select{|ent| ent[:workflow_state] == 'active' }
50
- admin_entries.map{|ent| ent[:role] }
51
- end
52
- end
53
- end
54
-
55
- def lti_roles
56
- @lti_roles ||= RoleStore.new(launch_params["https://purl.imsglobal.org/spec/lti/claim/roles"] || launch_params['ext_roles'] || '')
57
- end
58
-
59
- def canvas_site_admin?
60
- lti_roles.system_roles.include?("sys_admin")
61
- end
62
-
63
- class RoleStore
64
- ContextTypeURN = 'urn:lti:context-type:ims/lis/'.freeze
65
-
66
- ROLE_TYPES = [
67
- { type: "system", urn: "urn:lti:sysrole:ims/lis/", url: "http://purl.imsglobal.org/vocab/lis/v2/system/person#" },
68
- { type: "institution", urn: "urn:lti:instrole:ims/lis/", url: "http://purl.imsglobal.org/vocab/lis/v2/institution/person#" },
69
- { type: "context", urn: "urn:lti:role:ims/lis/", url: "http://purl.imsglobal.org/vocab/lis/v2/membership#" },
70
- ]
71
-
72
- attr_accessor :roles, :context_types, :other_roles
73
-
74
- def initialize(roles = '')
75
- roles = roles.split(',') if roles.is_a?(String)
76
- @roles = roles || []
77
-
78
- @context_types = []
79
- @other_roles = []
80
- @parsed_roles = HashWithIndifferentAccess.new
81
-
82
- map_roles
83
- end
84
-
85
- def system_roles; @parsed_roles[:system] || []; end
86
- def institution_roles; @parsed_roles[:institution] || []; end
87
- def context_roles; @parsed_roles[:context] || []; end
88
-
89
- def to_h
90
- {
91
- 'roles' => roles,
92
- 'context_type' => context_types,
93
- 'system_roles' => system_roles,
94
- 'institution_roles' => institution_roles,
95
- 'context_roles' => context_roles
96
- }
97
- end
98
-
99
- protected
100
-
101
- def map_roles
102
- roles.each do |role|
103
- if role.downcase.include?(ContextTypeURN)
104
- context_types << clean_role(ContextTypeURN, role)
105
- elsif (simple_role, type = match_role(role)).present?
106
- (@parsed_roles[type[:type]] ||= []) << simple_role
107
- else
108
- other_roles << role
109
- end
110
- end
111
- end
112
-
113
- def match_role(role)
114
- ROLE_TYPES.each do |rt|
115
- # LIS V1
116
- if role.downcase.start_with?(rt[:urn])
117
- return clean_role(rt[:urn], role), rt
118
- end
119
-
120
- # LIS V2
121
- if role.downcase.start_with?(rt[:url])
122
- return role.split('#')[1].underscore, rt
123
- end
124
- end
125
-
126
- nil
127
- end
128
-
129
- def clean_role(urn_prefix, role)
130
- role.gsub(/#{Regexp.quote(urn_prefix)}/i, '').gsub('/', '').underscore
131
- end
132
- end
6
+ # @abstract Implemented by PandaPal
7
+ def panda_pal_session; end
133
8
 
134
9
  # Middle Domain
135
10
 
136
11
  def launch_context
137
12
  @launch_context ||= begin
138
- if lti_launch_placement == "global_navigation"
13
+ if panda_pal_session.lti_launch_placement == "global_navigation"
139
14
  :global
140
- elsif get_lti_cust_param('custom_canvas_course_id').present?
141
- ::Course.find_by(canvas_id: get_lti_cust_param('custom_canvas_course_id'))
15
+ elsif panda_pal_session.get_lti_cust_param('custom_canvas_course_id').present?
16
+ ::Course.find_by(canvas_id: panda_pal_session.get_lti_cust_param('custom_canvas_course_id'))
142
17
  else
143
- ::Account.find_by(canvas_id: get_lti_cust_param('custom_canvas_account_id'))
18
+ ::Account.find_by(canvas_id: panda_pal_session.get_lti_cust_param('custom_canvas_account_id'))
144
19
  end
145
20
  end
146
21
  end
147
22
 
148
23
  def launch_account
149
- @launch_account ||= launch_context.respond_to?(:account) ? launch_context.account : ::Account.find_by(canvas_id: get_lti_cust_param('custom_canvas_account_id'))
150
- end
151
-
152
- def cache_on_session(key, &blk)
153
- panda_pal_session[:ability_cache] ||= {}
154
- panda_pal_session[:ability_cache][key] ||= blk.call
24
+ @launch_account ||= launch_context.respond_to?(:account) ?
25
+ launch_context.account :
26
+ ::Account.find_by(canvas_id: panda_pal_session.get_lti_cust_param('custom_canvas_account_id'))
155
27
  end
156
28
 
157
29
  # CanvasSync Domain
158
30
 
159
31
  def canvas_permissions
160
- panda_pal_session[:canvas_permissions] ||= ::Role.role_permissions(canvas_roles)
32
+ panda_pal_session[:canvas_permissions] ||= ::Role.joined_permissions(canvas_roles)
161
33
  end
162
34
 
163
35
  def canvas_roles
164
- @canvas_roles ||= Role.for_labels(canvas_role_labels, launch_account)
36
+ @canvas_roles ||= Role.for_labels(panda_pal_session.canvas_role_labels, launch_account)
165
37
  end
166
38
 
167
39
  def canvas_root_account_roles
168
- role_labels = canvas_account_role_labels('self')
40
+ role_labels = panda_pal_session.canvas_account_role_labels('self')
169
41
  ::Role.for_labels(role_labels, ::Account.find_by(canvas_parent_account_id: nil))
170
42
  end
171
43
 
@@ -178,13 +50,13 @@ module CanvasSync::Concerns
178
50
  end
179
51
 
180
52
  def canvas_super_user?
181
- cache_on_session(:canvas_super_user?) do
182
- canvas_site_admin? || (canvas_account_role_labels(:root) & ["AccountAdmin", "Account Admin"]).present?
53
+ panda_pal_session.cache(:canvas_super_user?) do
54
+ panda_pal_session.canvas_site_admin? || (panda_pal_session.canvas_account_role_labels(:root) & ["AccountAdmin", "Account Admin"]).present?
183
55
  end
184
56
  end
185
57
 
186
58
  def canvas_user_id
187
- user&.canvas_id || get_lti_cust_param('canvas_user_id')
59
+ user&.canvas_id || panda_pal_session.get_lti_cust_param('canvas_user_id')
188
60
  end
189
61
  end
190
62
  end
@@ -11,7 +11,7 @@ module CanvasSync::Concerns
11
11
  extend ActiveSupport::Concern
12
12
  include CanvasSync::Record
13
13
 
14
- CanvasSync::Record.define_feature self, default: ->{ column_names.include?("ancestry") }
14
+ CanvasSync::Record.define_feature self, default: ->{ column_names.include?("ancestry") rescue nil }
15
15
 
16
16
  included do
17
17
  has_ancestry
@@ -1,7 +1,7 @@
1
1
  module CanvasSync::Concerns
2
2
  module ApiSyncable
3
3
  extend ActiveSupport::Concern
4
- NON_EXISTANT_ERRORS = [Faraday::Error::ResourceNotFound, Footrest::HttpError::NotFound]
4
+ NON_EXISTANT_ERRORS = [Faraday::ResourceNotFound, Footrest::HttpError::NotFound]
5
5
 
6
6
  class_methods do
7
7
  def find_or_fetch(canvas_id, save: false, retries: 1, **kwargs)
@@ -0,0 +1,17 @@
1
+ # <%= autogenerated_migration_warning %>
2
+
3
+ class CreateCourseNicknames < ActiveRecord::Migration[5.1]
4
+ def change
5
+ create_table :course_nicknames do |t|
6
+ t.bigint :canvas_user_preference_value_id, null: false
7
+ t.integer :canvas_user_id
8
+ t.integer :canvas_course_id
9
+ t.string :nickname
10
+
11
+ t.timestamps
12
+ end
13
+
14
+ add_index :course_nicknames, :canvas_user_preference_value_id, unique: true
15
+ add_index :course_nicknames, [:canvas_course_id, :canvas_user_id], unique: true
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # # <%= autogenerated_migration_warning %>
4
+
5
+ class CourseNickname < ApplicationRecord
6
+ include CanvasSync::Record
7
+ include CanvasSync::Concerns::ApiSyncable
8
+
9
+ canvas_sync_features :defaults
10
+
11
+ belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
12
+ belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
13
+ end
@@ -565,3 +565,21 @@ learning_outcomes:
565
565
  description:
566
566
  database_column_name: description
567
567
  type: string
568
+
569
+ course_nicknames:
570
+ conflict_target:
571
+ - canvas_user_id
572
+ - canvas_course_id
573
+ report_columns:
574
+ user_preference_value_id:
575
+ database_column_name: canvas_user_preference_value_id
576
+ type: integer
577
+ canvas_user_id:
578
+ database_column_name: canvas_user_id
579
+ type: integer
580
+ canvas_course_id:
581
+ database_column_name: canvas_course_id
582
+ type: integer
583
+ nickname:
584
+ database_column_name: nickname
585
+ type: string
@@ -123,6 +123,16 @@ module CanvasSync
123
123
  row
124
124
  end
125
125
  end
126
+
127
+ def bulk_process_course_nicknames(report_file_path)
128
+ exists = []
129
+ do_bulk_import(report_file_path, CourseNickname, options: @options) do |row|
130
+ exists << row[:user_preference_value_id]
131
+ row
132
+ end
133
+ # Canvas does not soft delete UserPreferenceValues so there's no point in doing the same
134
+ CourseNickname.where.not(canvas_user_preference_value_id: exists).delete_all
135
+ end
126
136
  end
127
137
  end
128
138
  end
@@ -47,7 +47,7 @@ module CanvasSync
47
47
  feat = applicable_canvas_sync_features[feature]
48
48
 
49
49
  if !feat
50
- raise "Unkown feature :#{feature} for model #{self}"
50
+ raise "Unknown feature :#{feature} for model #{self}"
51
51
  end
52
52
 
53
53
  setup = feat[:setup]
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.19.0.beta10".freeze
2
+ VERSION = "0.19.1.beta1".freeze
3
3
  end
data/lib/canvas_sync.rb CHANGED
@@ -46,6 +46,7 @@ module CanvasSync
46
46
  grading_period_groups
47
47
  content_migrations
48
48
  learning_outcomes
49
+ course_nicknames
49
50
  ].freeze
50
51
 
51
52
  SUPPORTED_TERM_SCOPE_MODELS = %w[
@@ -131,6 +131,15 @@ RSpec.describe CanvasSync::Processors::ProvisioningReportProcessor do
131
131
  }.to change { LearningOutcome.count }.by(2)
132
132
  end
133
133
 
134
+ it 'processes course_nicknames' do
135
+ CourseNickname.create(canvas_user_preference_value_id: 42, canvas_course_id: 42, canvas_user_id: 42, nickname: 'test')
136
+ expect(CourseNickname.all.pluck(:canvas_user_preference_value_id)).to include(42)
137
+ expect {
138
+ subject.process('spec/support/fixtures/reports/course_nicknames.csv', { models: ['course_nicknames'] }, 1)
139
+ }.to change { CourseNickname.count }.by(1)
140
+ expect(CourseNickname.all.pluck(:canvas_user_preference_value_id)).not_to include(42)
141
+ end
142
+
134
143
  it 'model with composite key behaves as expected' do
135
144
  expect {
136
145
  subject.process('spec/support/fixtures/reports/user_observers.csv', { models: ['user_observers'] }, 1)
@@ -11,6 +11,8 @@ class Account < ApplicationRecord
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
  # include CanvasSync::Concerns::Account::Ancestry # Add support for the ancestry Gem
13
13
 
14
+ canvas_sync_features :defaults
15
+
14
16
  validates :canvas_id, uniqueness: true, presence: true
15
17
 
16
18
  has_many :admins, primary_key: :canvas_id, foreign_key: :canvas_account_id
@@ -10,6 +10,8 @@ class Admin < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :account, primary_key: :canvas_id, foreign_key: :canvas_account_id, optional: true
15
17
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
@@ -10,6 +10,8 @@ class Assignment < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :context, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type
15
17
  belongs_to :assignment_group, optional: true, primary_key: :canvas_id, foreign_key: :canvas_assignment_group_id
@@ -10,6 +10,8 @@ class AssignmentGroup < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
15
17
  has_many :assignments, primary_key: :canvas_id, foreign_key: :canvas_assignment_group_id
@@ -10,6 +10,8 @@ class ContentMigration < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :context, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type
15
17
 
@@ -13,6 +13,8 @@ class ContextModule < ApplicationRecord
13
13
  include CanvasSync::Record
14
14
  include CanvasSync::Concerns::ApiSyncable
15
15
 
16
+ canvas_sync_features :defaults
17
+
16
18
  belongs_to :context, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type
17
19
  has_many :context_module_items, primary_key: :canvas_id, foreign_key: :canvas_context_module_id
18
20
  has_many :assignments, through: :context_module_items
@@ -10,6 +10,8 @@ class ContextModuleItem < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  belongs_to :context_module, primary_key: :canvas_id, foreign_key: :canvas_context_module_id, optional: true
14
16
  belongs_to :content, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_content_id, foreign_type: :canvas_content_type
15
17
  belongs_to :assignment, foreign_key: :canvas_assignment_id, primary_key: :canvas_id
@@ -10,6 +10,8 @@ class Course < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :term, foreign_key: :canvas_term_id, primary_key: :canvas_id, optional: true
15
17
  has_many :enrollments, primary_key: :canvas_id, foreign_key: :canvas_course_id
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # # #
4
+ # AUTO GENERATED MIGRATION
5
+ # This migration was auto generated by the CanvasSync Gem.
6
+ # You can add new columns to this table, but removing or
7
+ # re-naming ones created here may break Canvas Syncing.
8
+ #
9
+
10
+
11
+ class CourseNickname < ApplicationRecord
12
+ include CanvasSync::Record
13
+ include CanvasSync::Concerns::ApiSyncable
14
+
15
+ canvas_sync_features :defaults
16
+
17
+ belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
18
+ belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
19
+ end
@@ -10,6 +10,8 @@ class Enrollment < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
15
17
  belongs_to :role, primary_key: :canvas_id, foreign_key: :canvas_role_id, optional: true
@@ -9,6 +9,8 @@
9
9
  class GradingPeriod < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
 
12
+ canvas_sync_features :defaults
13
+
12
14
  validates :canvas_id, uniqueness: true, presence: true
13
15
  belongs_to :grading_period_group, primary_key: :canvas_id, foreign_key: :canvas_grading_period_group_id, optional: true
14
16
  end
@@ -9,5 +9,7 @@
9
9
  class GradingPeriodGroup < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
 
12
+ canvas_sync_features :defaults
13
+
12
14
  validates :canvas_id, uniqueness: true, presence: true
13
15
  end
@@ -10,6 +10,8 @@ class Group < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
15
17
  belongs_to :account, primary_key: :canvas_id, foreign_key: :canvas_account_id, optional: true
@@ -10,6 +10,8 @@ class GroupMembership < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :group, primary_key: :canvas_id, foreign_key: :canvas_group_id
15
17
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id
@@ -12,6 +12,8 @@ class LearningOutcome < ApplicationRecord
12
12
  include CanvasSync::Record
13
13
  include CanvasSync::Concerns::ApiSyncable
14
14
 
15
+ canvas_sync_features :defaults
16
+
15
17
  belongs_to :context, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type
16
18
 
17
19
  api_syncable({
@@ -9,6 +9,8 @@
9
9
  class Pseudonym < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
 
12
+ canvas_sync_features :defaults
13
+
12
14
  validates :canvas_id, uniqueness: true, presence: true
13
15
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id
14
16
  end
@@ -10,6 +10,8 @@ class Role < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  has_many :admins, foreign_key: :canvas_role_id, primary_key: :canvas_id
15
17
 
@@ -10,6 +10,8 @@ class Section < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
15
17
  has_many :enrollments, primary_key: :canvas_id, foreign_key: :canvas_section_id
@@ -10,6 +10,8 @@ class Submission < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  belongs_to :assignment, primary_key: :canvas_id, foreign_key: :canvas_assignment_id, optional: true
15
17
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
@@ -10,6 +10,8 @@ class Term < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  has_many :courses, foreign_key: :canvas_term_id, primary_key: :canvas_id
15
17
  belongs_to :grading_period_group, primary_key: :canvas_id, foreign_key: :grading_period_group_id, optional: true
@@ -10,6 +10,8 @@ class User < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
  has_many :pseudonyms, primary_key: :canvas_id, foreign_key: :canvas_user_id
15
17
  has_many :enrollments, primary_key: :canvas_id, foreign_key: :canvas_user_id
@@ -10,6 +10,8 @@ class UserObserver < ApplicationRecord
10
10
  include CanvasSync::Record
11
11
  include CanvasSync::Concerns::ApiSyncable
12
12
 
13
+ canvas_sync_features :defaults
14
+
13
15
  validates :canvas_id, uniqueness: true, presence: true
14
16
 
15
17
  belongs_to :observing_user, primary_key: :canvas_id, foreign_key: :observing_user_id, class_name: 'User', optional: true
@@ -0,0 +1,23 @@
1
+ # #
2
+ # AUTO GENERATED MIGRATION
3
+ # This migration was auto generated by the CanvasSync Gem.
4
+ # You can add new columns to this table, but removing or
5
+ # re-naming ones created here may break Canvas Syncing.
6
+ #
7
+
8
+
9
+ class CreateCourseNicknames < ActiveRecord::Migration[5.1]
10
+ def change
11
+ create_table :course_nicknames do |t|
12
+ t.bigint :canvas_user_preference_value_id, null: false
13
+ t.integer :canvas_user_id
14
+ t.integer :canvas_course_id
15
+ t.string :nickname
16
+
17
+ t.timestamps
18
+ end
19
+
20
+ add_index :course_nicknames, :canvas_user_preference_value_id, unique: true
21
+ add_index :course_nicknames, [:canvas_course_id, :canvas_user_id], unique: true
22
+ end
23
+ end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2022_09_26_221926) do
13
+ ActiveRecord::Schema.define(version: 2024_04_08_223326) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -157,6 +157,17 @@ ActiveRecord::Schema.define(version: 2022_09_26_221926) do
157
157
  t.index ["canvas_id"], name: "index_context_modules_on_canvas_id", unique: true
158
158
  end
159
159
 
160
+ create_table "course_nicknames", force: :cascade do |t|
161
+ t.bigint "canvas_user_preference_value_id", null: false
162
+ t.integer "canvas_user_id"
163
+ t.integer "canvas_course_id"
164
+ t.string "nickname"
165
+ t.datetime "created_at", null: false
166
+ t.datetime "updated_at", null: false
167
+ t.index ["canvas_course_id", "canvas_user_id"], name: "index_course_nicknames_on_canvas_course_id_and_canvas_user_id", unique: true
168
+ t.index ["canvas_user_preference_value_id"], name: "index_course_nicknames_on_canvas_user_preference_value_id", unique: true
169
+ end
170
+
160
171
  create_table "courses", force: :cascade do |t|
161
172
  t.bigint "canvas_id", null: false
162
173
  t.string "sis_id"
@@ -0,0 +1,3 @@
1
+ user_preference_value_id,canvas_user_id,canvas_course_id,nickname
2
+ 86,17,35,foo
3
+ 123,8348,12,bar
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.19.0.beta10
4
+ version: 0.19.1.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -388,7 +388,7 @@ dependencies:
388
388
  - - ">="
389
389
  - !ruby/object:Gem::Version
390
390
  version: '0'
391
- description:
391
+ description:
392
392
  email:
393
393
  - pseng@instructure.com
394
394
  executables: []
@@ -415,7 +415,6 @@ files:
415
415
  - lib/canvas_sync/concerns/account/ancestry.rb
416
416
  - lib/canvas_sync/concerns/account/base.rb
417
417
  - lib/canvas_sync/concerns/api_syncable.rb
418
- - lib/canvas_sync/concerns/auto_relations.rb
419
418
  - lib/canvas_sync/concerns/legacy_columns.rb
420
419
  - lib/canvas_sync/concerns/role/base.rb
421
420
  - lib/canvas_sync/concerns/sync_mapping.rb
@@ -430,6 +429,7 @@ files:
430
429
  - lib/canvas_sync/generators/templates/migrations/create_content_migrations.rb
431
430
  - lib/canvas_sync/generators/templates/migrations/create_context_module_items.rb
432
431
  - lib/canvas_sync/generators/templates/migrations/create_context_modules.rb
432
+ - lib/canvas_sync/generators/templates/migrations/create_course_nicknames.rb
433
433
  - lib/canvas_sync/generators/templates/migrations/create_courses.rb
434
434
  - lib/canvas_sync/generators/templates/migrations/create_enrollments.rb
435
435
  - lib/canvas_sync/generators/templates/migrations/create_grading_period_groups.rb
@@ -452,6 +452,7 @@ files:
452
452
  - lib/canvas_sync/generators/templates/models/context_module.rb
453
453
  - lib/canvas_sync/generators/templates/models/context_module_item.rb
454
454
  - lib/canvas_sync/generators/templates/models/course.rb
455
+ - lib/canvas_sync/generators/templates/models/course_nickname.rb
455
456
  - lib/canvas_sync/generators/templates/models/enrollment.rb
456
457
  - lib/canvas_sync/generators/templates/models/grading_period.rb
457
458
  - lib/canvas_sync/generators/templates/models/grading_period_group.rb
@@ -597,6 +598,7 @@ files:
597
598
  - spec/dummy/app/models/context_module.rb
598
599
  - spec/dummy/app/models/context_module_item.rb
599
600
  - spec/dummy/app/models/course.rb
601
+ - spec/dummy/app/models/course_nickname.rb
600
602
  - spec/dummy/app/models/enrollment.rb
601
603
  - spec/dummy/app/models/grading_period.rb
602
604
  - spec/dummy/app/models/grading_period_group.rb
@@ -673,6 +675,7 @@ files:
673
675
  - spec/dummy/db/migrate/20220308072643_create_content_migrations.rb
674
676
  - spec/dummy/db/migrate/20220712210559_create_learning_outcomes.rb
675
677
  - spec/dummy/db/migrate/20220926221926_create_users.rb
678
+ - spec/dummy/db/migrate/20240408223326_create_course_nicknames.rb
676
679
  - spec/dummy/db/schema.rb
677
680
  - spec/factories/account_factory.rb
678
681
  - spec/factories/admin_factory.rb
@@ -717,6 +720,7 @@ files:
717
720
  - spec/support/fixtures/reports/content_migrations.csv
718
721
  - spec/support/fixtures/reports/context_module_items.csv
719
722
  - spec/support/fixtures/reports/context_modules.csv
723
+ - spec/support/fixtures/reports/course_nicknames.csv
720
724
  - spec/support/fixtures/reports/courses.csv
721
725
  - spec/support/fixtures/reports/enrollments.csv
722
726
  - spec/support/fixtures/reports/grading_period_groups.csv
@@ -735,7 +739,7 @@ files:
735
739
  homepage: https://instructure.com
736
740
  licenses: []
737
741
  metadata: {}
738
- post_install_message:
742
+ post_install_message:
739
743
  rdoc_options: []
740
744
  require_paths:
741
745
  - lib
@@ -746,201 +750,204 @@ required_ruby_version: !ruby/object:Gem::Requirement
746
750
  version: '0'
747
751
  required_rubygems_version: !ruby/object:Gem::Requirement
748
752
  requirements:
749
- - - ">"
753
+ - - ">="
750
754
  - !ruby/object:Gem::Version
751
- version: 1.3.1
755
+ version: '0'
752
756
  requirements: []
753
- rubygems_version: 3.1.6
754
- signing_key:
757
+ rubygems_version: 3.5.4
758
+ signing_key:
755
759
  specification_version: 4
756
760
  summary: Gem for generating Canvas models and migrations and syncing data from Canvas
757
761
  test_files:
758
- - spec/canvas_sync/services/module_event_spec.rb
759
- - spec/canvas_sync/services/module_item_event_spec.rb
762
+ - spec/canvas_sync/canvas_sync_spec.rb
763
+ - spec/canvas_sync/jobs/canvas_process_waiter_spec.rb
764
+ - spec/canvas_sync/jobs/job_spec.rb
765
+ - spec/canvas_sync/jobs/report_checker_spec.rb
766
+ - spec/canvas_sync/jobs/report_processor_job_spec.rb
767
+ - spec/canvas_sync/jobs/report_starter_spec.rb
768
+ - spec/canvas_sync/jobs/sync_admins_job_spec.rb
769
+ - spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb
770
+ - spec/canvas_sync/jobs/sync_assignments_job_spec.rb
771
+ - spec/canvas_sync/jobs/sync_content_migrations_job_spec.rb
772
+ - spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
773
+ - spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
774
+ - spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb
775
+ - spec/canvas_sync/jobs/sync_roles_job_spec.rb
776
+ - spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
777
+ - spec/canvas_sync/jobs/sync_submissions_job_spec.rb
778
+ - spec/canvas_sync/jobs/sync_terms_job_spec.rb
779
+ - spec/canvas_sync/misc_helper_spec.rb
780
+ - spec/canvas_sync/models/accounts_spec.rb
760
781
  - spec/canvas_sync/models/admins_spec.rb
782
+ - spec/canvas_sync/models/assignment_group_spec.rb
761
783
  - spec/canvas_sync/models/assignment_spec.rb
784
+ - spec/canvas_sync/models/context_module_item_spec.rb
762
785
  - spec/canvas_sync/models/context_module_spec.rb
786
+ - spec/canvas_sync/models/course_spec.rb
787
+ - spec/canvas_sync/models/enrollment_spec.rb
763
788
  - spec/canvas_sync/models/group_membership_spec.rb
764
- - spec/canvas_sync/models/context_module_item_spec.rb
789
+ - spec/canvas_sync/models/group_spec.rb
765
790
  - spec/canvas_sync/models/roles_spec.rb
766
- - spec/canvas_sync/models/accounts_spec.rb
767
791
  - spec/canvas_sync/models/section_spec.rb
768
- - spec/canvas_sync/models/group_spec.rb
769
792
  - spec/canvas_sync/models/submission_spec.rb
770
793
  - spec/canvas_sync/models/term_spec.rb
771
- - spec/canvas_sync/models/enrollment_spec.rb
772
- - spec/canvas_sync/models/course_spec.rb
773
794
  - spec/canvas_sync/models/user_spec.rb
774
- - spec/canvas_sync/models/assignment_group_spec.rb
775
- - spec/canvas_sync/misc_helper_spec.rb
776
- - spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
777
- - spec/canvas_sync/jobs/sync_terms_job_spec.rb
778
- - spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
779
- - spec/canvas_sync/jobs/sync_assignments_job_spec.rb
780
- - spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb
781
- - spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb
782
- - spec/canvas_sync/jobs/sync_admins_job_spec.rb
783
- - spec/canvas_sync/jobs/report_starter_spec.rb
784
- - spec/canvas_sync/jobs/sync_content_migrations_job_spec.rb
785
- - spec/canvas_sync/jobs/job_spec.rb
786
- - spec/canvas_sync/jobs/report_processor_job_spec.rb
787
- - spec/canvas_sync/jobs/canvas_process_waiter_spec.rb
788
- - spec/canvas_sync/jobs/sync_submissions_job_spec.rb
789
- - spec/canvas_sync/jobs/report_checker_spec.rb
790
- - spec/canvas_sync/jobs/sync_roles_job_spec.rb
791
- - spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
792
- - spec/canvas_sync/canvas_sync_spec.rb
793
- - spec/canvas_sync/processors/provisioning_report_processor_spec.rb
794
- - spec/canvas_sync/processors/content_migrations_processor_spec.rb
795
+ - spec/canvas_sync/processors/assignment_groups_processor_spec.rb
795
796
  - spec/canvas_sync/processors/assignments_processor_spec.rb
796
- - spec/canvas_sync/processors/normal_processor_spec.rb
797
+ - spec/canvas_sync/processors/content_migrations_processor_spec.rb
798
+ - spec/canvas_sync/processors/context_module_items_processor_spec.rb
797
799
  - spec/canvas_sync/processors/context_modules_processor_spec.rb
798
- - spec/canvas_sync/processors/assignment_groups_processor_spec.rb
800
+ - spec/canvas_sync/processors/normal_processor_spec.rb
801
+ - spec/canvas_sync/processors/provisioning_report_processor_spec.rb
799
802
  - spec/canvas_sync/processors/submissions_processor_spec.rb
800
- - spec/canvas_sync/processors/context_module_items_processor_spec.rb
801
- - spec/job_batching/integration_helper.rb
802
- - spec/job_batching/pool_spec.rb
803
- - spec/job_batching/integration/integration.rb
804
- - spec/job_batching/integration/workflow.rb
805
- - spec/job_batching/integration/fail_then_succeed.rb
806
- - spec/job_batching/integration/nested.rb
807
- - spec/job_batching/integration/simple.rb
808
- - spec/job_batching/active_job_spec.rb
809
- - spec/job_batching/status_spec.rb
810
- - spec/job_batching/callback_spec.rb
811
- - spec/job_batching/sidekiq_spec.rb
812
- - spec/job_batching/support/base_job.rb
813
- - spec/job_batching/support/sample_callback.rb
814
- - spec/job_batching/batch_spec.rb
815
- - spec/job_batching/flow_spec.rb
816
- - spec/job_batching/context_hash_spec.rb
817
- - spec/spec_helper.rb
818
- - spec/support/fake_canvas.rb
819
- - spec/support/fixtures/reports/submissions.csv
820
- - spec/support/fixtures/reports/assignments.csv
821
- - spec/support/fixtures/reports/user_observers.csv
822
- - spec/support/fixtures/reports/xlist.csv
823
- - spec/support/fixtures/reports/sections.csv
824
- - spec/support/fixtures/reports/context_modules.csv
825
- - spec/support/fixtures/reports/users.csv
826
- - spec/support/fixtures/reports/grading_period_groups.csv
827
- - spec/support/fixtures/reports/learning_outcomes.csv
828
- - spec/support/fixtures/reports/groups.csv
829
- - spec/support/fixtures/reports/courses.csv
830
- - spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
831
- - spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
832
- - spec/support/fixtures/reports/assignment_groups.csv
833
- - spec/support/fixtures/reports/group_memberships.csv
834
- - spec/support/fixtures/reports/enrollments.csv
835
- - spec/support/fixtures/reports/provisioning_csv
836
- - spec/support/fixtures/reports/grading_periods.csv
837
- - spec/support/fixtures/reports/content_migrations.csv
838
- - spec/support/fixtures/reports/context_module_items.csv
839
- - spec/support/fixtures/canvas_responses/module.json
840
- - spec/support/fixtures/canvas_responses/terms.json
841
- - spec/support/fixtures/canvas_responses/admins.json
842
- - spec/support/fixtures/canvas_responses/roles.json
843
- - spec/support/fixtures/canvas_responses/module_item.json
844
- - spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
845
- - spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
846
- - spec/dummy/db/migrate/20190702203627_create_submissions.rb
847
- - spec/dummy/db/migrate/20190702203624_create_enrollments.rb
848
- - spec/dummy/db/migrate/20190702203621_create_courses.rb
849
- - spec/dummy/db/migrate/20211001184920_create_grading_period_groups.rb
850
- - spec/dummy/db/migrate/20220712210559_create_learning_outcomes.rb
851
- - spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
852
- - spec/dummy/db/migrate/20220926221926_create_users.rb
853
- - spec/dummy/db/migrate/20210907233330_create_grading_periods.rb
854
- - spec/dummy/db/migrate/20190702203631_create_context_modules.rb
855
- - spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
856
- - spec/dummy/db/migrate/20190927204545_create_roles.rb
857
- - spec/dummy/db/migrate/20190702203622_create_accounts.rb
858
- - spec/dummy/db/migrate/20190702203626_create_assignments.rb
859
- - spec/dummy/db/migrate/20200415171620_create_groups.rb
860
- - spec/dummy/db/migrate/20190927204546_create_admins.rb
861
- - spec/dummy/db/migrate/20190702203625_create_sections.rb
862
- - spec/dummy/db/migrate/20210907233329_create_user_observers.rb
863
- - spec/dummy/db/migrate/20190702203623_create_terms.rb
864
- - spec/dummy/db/migrate/20220308072643_create_content_migrations.rb
865
- - spec/dummy/db/schema.rb
803
+ - spec/canvas_sync/services/module_event_spec.rb
804
+ - spec/canvas_sync/services/module_item_event_spec.rb
805
+ - spec/dummy/README.rdoc
866
806
  - spec/dummy/Rakefile
867
- - spec/dummy/app/services/live_events/submission_event.rb
868
- - spec/dummy/app/services/live_events/module_created_event.rb
869
- - spec/dummy/app/services/live_events/module_item_created_event.rb
870
- - spec/dummy/app/services/live_events/user_created_event.rb
807
+ - spec/dummy/app/models/account.rb
808
+ - spec/dummy/app/models/admin.rb
809
+ - spec/dummy/app/models/application_record.rb
810
+ - spec/dummy/app/models/assignment.rb
811
+ - spec/dummy/app/models/assignment_group.rb
812
+ - spec/dummy/app/models/content_migration.rb
813
+ - spec/dummy/app/models/context_module.rb
814
+ - spec/dummy/app/models/context_module_item.rb
815
+ - spec/dummy/app/models/course.rb
816
+ - spec/dummy/app/models/course_nickname.rb
817
+ - spec/dummy/app/models/enrollment.rb
818
+ - spec/dummy/app/models/grading_period.rb
819
+ - spec/dummy/app/models/grading_period_group.rb
820
+ - spec/dummy/app/models/group.rb
821
+ - spec/dummy/app/models/group_membership.rb
822
+ - spec/dummy/app/models/learning_outcome.rb
823
+ - spec/dummy/app/models/pseudonym.rb
824
+ - spec/dummy/app/models/role.rb
825
+ - spec/dummy/app/models/section.rb
826
+ - spec/dummy/app/models/submission.rb
827
+ - spec/dummy/app/models/term.rb
828
+ - spec/dummy/app/models/user.rb
829
+ - spec/dummy/app/models/user_observer.rb
830
+ - spec/dummy/app/services/live_events/assignment_created_event.rb
831
+ - spec/dummy/app/services/live_events/assignment_event.rb
832
+ - spec/dummy/app/services/live_events/assignment_updated_event.rb
871
833
  - spec/dummy/app/services/live_events/base_event.rb
834
+ - spec/dummy/app/services/live_events/course_created_event.rb
835
+ - spec/dummy/app/services/live_events/course_event.rb
872
836
  - spec/dummy/app/services/live_events/course_section_created_event.rb
873
- - spec/dummy/app/services/live_events/user_updated_event.rb
837
+ - spec/dummy/app/services/live_events/course_section_event.rb
838
+ - spec/dummy/app/services/live_events/course_section_updated_event.rb
874
839
  - spec/dummy/app/services/live_events/course_updated_event.rb
875
- - spec/dummy/app/services/live_events/submission_created_event.rb
876
- - spec/dummy/app/services/live_events/syllabus_event.rb
877
- - spec/dummy/app/services/live_events/module_updated_event.rb
878
- - spec/dummy/app/services/live_events/course_event.rb
879
840
  - spec/dummy/app/services/live_events/enrollment_created_event.rb
880
- - spec/dummy/app/services/live_events/grade_event.rb
881
- - spec/dummy/app/services/live_events/course_section_updated_event.rb
882
- - spec/dummy/app/services/live_events/course_created_event.rb
883
841
  - spec/dummy/app/services/live_events/enrollment_event.rb
884
- - spec/dummy/app/services/live_events/assignment_updated_event.rb
885
- - spec/dummy/app/services/live_events/syllabus_updated_event.rb
842
+ - spec/dummy/app/services/live_events/enrollment_updated_event.rb
886
843
  - spec/dummy/app/services/live_events/grade_changed_event.rb
887
- - spec/dummy/app/services/live_events/module_item_updated_event.rb
844
+ - spec/dummy/app/services/live_events/grade_event.rb
845
+ - spec/dummy/app/services/live_events/module_created_event.rb
888
846
  - spec/dummy/app/services/live_events/module_event.rb
889
- - spec/dummy/app/services/live_events/course_section_event.rb
890
- - spec/dummy/app/services/live_events/assignment_created_event.rb
891
- - spec/dummy/app/services/live_events/enrollment_updated_event.rb
892
- - spec/dummy/app/services/live_events/assignment_event.rb
847
+ - spec/dummy/app/services/live_events/module_item_created_event.rb
893
848
  - spec/dummy/app/services/live_events/module_item_event.rb
849
+ - spec/dummy/app/services/live_events/module_item_updated_event.rb
850
+ - spec/dummy/app/services/live_events/module_updated_event.rb
851
+ - spec/dummy/app/services/live_events/submission_created_event.rb
852
+ - spec/dummy/app/services/live_events/submission_event.rb
894
853
  - spec/dummy/app/services/live_events/submission_updated_event.rb
854
+ - spec/dummy/app/services/live_events/syllabus_event.rb
855
+ - spec/dummy/app/services/live_events/syllabus_updated_event.rb
856
+ - spec/dummy/app/services/live_events/user_created_event.rb
895
857
  - spec/dummy/app/services/live_events/user_event.rb
896
- - spec/dummy/app/models/user.rb
897
- - spec/dummy/app/models/submission.rb
898
- - spec/dummy/app/models/group_membership.rb
899
- - spec/dummy/app/models/enrollment.rb
900
- - spec/dummy/app/models/role.rb
901
- - spec/dummy/app/models/account.rb
902
- - spec/dummy/app/models/application_record.rb
903
- - spec/dummy/app/models/admin.rb
904
- - spec/dummy/app/models/learning_outcome.rb
905
- - spec/dummy/app/models/grading_period.rb
906
- - spec/dummy/app/models/context_module.rb
907
- - spec/dummy/app/models/context_module_item.rb
908
- - spec/dummy/app/models/course.rb
909
- - spec/dummy/app/models/section.rb
910
- - spec/dummy/app/models/grading_period_group.rb
911
- - spec/dummy/app/models/user_observer.rb
912
- - spec/dummy/app/models/assignment_group.rb
913
- - spec/dummy/app/models/assignment.rb
914
- - spec/dummy/app/models/term.rb
915
- - spec/dummy/app/models/pseudonym.rb
916
- - spec/dummy/app/models/group.rb
917
- - spec/dummy/app/models/content_migration.rb
918
- - spec/dummy/config/secrets.yml
858
+ - spec/dummy/app/services/live_events/user_updated_event.rb
859
+ - spec/dummy/bin/rails
919
860
  - spec/dummy/config/application.rb
920
- - spec/dummy/config/initializers/session_store.rb
921
- - spec/dummy/config/initializers/wrap_parameters.rb
922
- - spec/dummy/config/initializers/assets.rb
861
+ - spec/dummy/config/boot.rb
862
+ - spec/dummy/config/database.yml
863
+ - spec/dummy/config/environment.rb
923
864
  - spec/dummy/config/environments/development.rb
924
865
  - spec/dummy/config/environments/test.rb
925
- - spec/dummy/config/database.yml
926
- - spec/dummy/config/boot.rb
866
+ - spec/dummy/config/initializers/assets.rb
867
+ - spec/dummy/config/initializers/session_store.rb
868
+ - spec/dummy/config/initializers/wrap_parameters.rb
927
869
  - spec/dummy/config/routes.rb
928
- - spec/dummy/config/environment.rb
929
- - spec/dummy/README.rdoc
870
+ - spec/dummy/config/secrets.yml
930
871
  - spec/dummy/config.ru
931
- - spec/dummy/bin/rails
872
+ - spec/dummy/db/migrate/20190702203621_create_courses.rb
873
+ - spec/dummy/db/migrate/20190702203622_create_accounts.rb
874
+ - spec/dummy/db/migrate/20190702203623_create_terms.rb
875
+ - spec/dummy/db/migrate/20190702203624_create_enrollments.rb
876
+ - spec/dummy/db/migrate/20190702203625_create_sections.rb
877
+ - spec/dummy/db/migrate/20190702203626_create_assignments.rb
878
+ - spec/dummy/db/migrate/20190702203627_create_submissions.rb
879
+ - spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
880
+ - spec/dummy/db/migrate/20190702203631_create_context_modules.rb
881
+ - spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
882
+ - spec/dummy/db/migrate/20190927204545_create_roles.rb
883
+ - spec/dummy/db/migrate/20190927204546_create_admins.rb
884
+ - spec/dummy/db/migrate/20200415171620_create_groups.rb
885
+ - spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
886
+ - spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
887
+ - spec/dummy/db/migrate/20210907233329_create_user_observers.rb
888
+ - spec/dummy/db/migrate/20210907233330_create_grading_periods.rb
889
+ - spec/dummy/db/migrate/20211001184920_create_grading_period_groups.rb
890
+ - spec/dummy/db/migrate/20220308072643_create_content_migrations.rb
891
+ - spec/dummy/db/migrate/20220712210559_create_learning_outcomes.rb
892
+ - spec/dummy/db/migrate/20220926221926_create_users.rb
893
+ - spec/dummy/db/migrate/20240408223326_create_course_nicknames.rb
894
+ - spec/dummy/db/schema.rb
932
895
  - spec/factories/account_factory.rb
933
- - spec/factories/term_factory.rb
934
- - spec/factories/enrollment_factory.rb
896
+ - spec/factories/admin_factory.rb
935
897
  - spec/factories/assignment_factory.rb
936
898
  - spec/factories/assignment_group_factory.rb
937
- - spec/factories/role_factory.rb
938
- - spec/factories/admin_factory.rb
899
+ - spec/factories/context_module_factory.rb
900
+ - spec/factories/context_module_item_factory.rb
901
+ - spec/factories/course_factory.rb
902
+ - spec/factories/enrollment_factory.rb
939
903
  - spec/factories/group_factory.rb
940
904
  - spec/factories/group_membership_factory.rb
905
+ - spec/factories/role_factory.rb
941
906
  - spec/factories/section_factory.rb
942
- - spec/factories/context_module_item_factory.rb
943
- - spec/factories/course_factory.rb
944
907
  - spec/factories/submission_factory.rb
908
+ - spec/factories/term_factory.rb
945
909
  - spec/factories/user_factory.rb
946
- - spec/factories/context_module_factory.rb
910
+ - spec/job_batching/active_job_spec.rb
911
+ - spec/job_batching/batch_spec.rb
912
+ - spec/job_batching/callback_spec.rb
913
+ - spec/job_batching/context_hash_spec.rb
914
+ - spec/job_batching/flow_spec.rb
915
+ - spec/job_batching/integration/fail_then_succeed.rb
916
+ - spec/job_batching/integration/integration.rb
917
+ - spec/job_batching/integration/nested.rb
918
+ - spec/job_batching/integration/simple.rb
919
+ - spec/job_batching/integration/workflow.rb
920
+ - spec/job_batching/integration_helper.rb
921
+ - spec/job_batching/pool_spec.rb
922
+ - spec/job_batching/sidekiq_spec.rb
923
+ - spec/job_batching/status_spec.rb
924
+ - spec/job_batching/support/base_job.rb
925
+ - spec/job_batching/support/sample_callback.rb
926
+ - spec/spec_helper.rb
927
+ - spec/support/fake_canvas.rb
928
+ - spec/support/fixtures/canvas_responses/admins.json
929
+ - spec/support/fixtures/canvas_responses/module.json
930
+ - spec/support/fixtures/canvas_responses/module_item.json
931
+ - spec/support/fixtures/canvas_responses/roles.json
932
+ - spec/support/fixtures/canvas_responses/terms.json
933
+ - spec/support/fixtures/reports/assignment_groups.csv
934
+ - spec/support/fixtures/reports/assignments.csv
935
+ - spec/support/fixtures/reports/content_migrations.csv
936
+ - spec/support/fixtures/reports/context_module_items.csv
937
+ - spec/support/fixtures/reports/context_modules.csv
938
+ - spec/support/fixtures/reports/course_nicknames.csv
939
+ - spec/support/fixtures/reports/courses.csv
940
+ - spec/support/fixtures/reports/enrollments.csv
941
+ - spec/support/fixtures/reports/grading_period_groups.csv
942
+ - spec/support/fixtures/reports/grading_periods.csv
943
+ - spec/support/fixtures/reports/group_memberships.csv
944
+ - spec/support/fixtures/reports/groups.csv
945
+ - spec/support/fixtures/reports/learning_outcomes.csv
946
+ - spec/support/fixtures/reports/provisioning_csv
947
+ - spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
948
+ - spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
949
+ - spec/support/fixtures/reports/sections.csv
950
+ - spec/support/fixtures/reports/submissions.csv
951
+ - spec/support/fixtures/reports/user_observers.csv
952
+ - spec/support/fixtures/reports/users.csv
953
+ - spec/support/fixtures/reports/xlist.csv
@@ -1,11 +0,0 @@
1
- module CanvasSync::Concerns
2
- module AutoRelations
3
- extend ActiveSupport::Concern
4
-
5
- # CanvasSync::Record.define_feature self, default: true
6
-
7
- included do
8
-
9
- end
10
- end
11
- end