canvas_sync 0.9.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/canvas_sync/api_syncable.rb +1 -0
- data/lib/canvas_sync/generators/install_generator.rb +3 -3
- data/lib/canvas_sync/generators/templates/migrations/create_accounts.rb +17 -0
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_admins.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_assignment_groups.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_assignments.rb +7 -7
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_context_module_items.rb +4 -4
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_context_modules.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_courses.rb +7 -8
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_enrollments.rb +4 -6
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_roles.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_sections.rb +5 -5
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_submissions.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_terms.rb +2 -2
- data/lib/canvas_sync/generators/templates/{models → migrations}/create_users.rb +4 -4
- data/lib/canvas_sync/generators/templates/models/account.rb +4 -4
- data/lib/canvas_sync/generators/templates/models/admin.rb +4 -4
- data/lib/canvas_sync/generators/templates/models/assignment.rb +10 -9
- data/lib/canvas_sync/generators/templates/models/assignment_group.rb +5 -5
- data/lib/canvas_sync/generators/templates/models/context_module.rb +2 -2
- data/lib/canvas_sync/generators/templates/models/context_module_item.rb +3 -2
- data/lib/canvas_sync/generators/templates/models/course.rb +14 -14
- data/lib/canvas_sync/generators/templates/models/enrollment.rb +10 -9
- data/lib/canvas_sync/generators/templates/models/role.rb +3 -3
- data/lib/canvas_sync/generators/templates/models/section.rb +6 -6
- data/lib/canvas_sync/generators/templates/models/submission.rb +5 -5
- data/lib/canvas_sync/generators/templates/models/term.rb +4 -3
- data/lib/canvas_sync/generators/templates/models/user.rb +6 -6
- data/lib/canvas_sync/generators/templates/services/live_events/base_event.rb +4 -0
- data/lib/canvas_sync/generators/templates/services/live_events/course/course_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_event.rb +4 -4
- data/lib/canvas_sync/generators/templates/services/live_events/module/module_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_event.rb +3 -3
- data/lib/canvas_sync/generators/templates/services/live_events/user/user_event.rb +1 -1
- data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +7 -2
- data/lib/canvas_sync/jobs/sync_simple_table_job.rb +7 -2
- data/lib/canvas_sync/processors/model_mappings.yml +35 -41
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +4 -4
- data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +3 -3
- data/spec/canvas_sync/models/accounts_spec.rb +2 -2
- data/spec/canvas_sync/models/admins_spec.rb +3 -3
- data/spec/canvas_sync/models/assignment_group_spec.rb +4 -4
- data/spec/canvas_sync/models/assignment_spec.rb +8 -8
- data/spec/canvas_sync/models/context_module_spec.rb +2 -2
- data/spec/canvas_sync/models/course_spec.rb +7 -8
- data/spec/canvas_sync/models/enrollment_spec.rb +5 -5
- data/spec/canvas_sync/models/roles_spec.rb +3 -3
- data/spec/canvas_sync/models/section_spec.rb +4 -4
- data/spec/canvas_sync/models/submission_spec.rb +5 -5
- data/spec/canvas_sync/models/term_spec.rb +7 -7
- data/spec/canvas_sync/models/user_spec.rb +4 -4
- data/spec/canvas_sync/processors/provisioning_report_processor_spec.rb +5 -5
- data/spec/canvas_sync/services/module_event_spec.rb +1 -1
- data/spec/canvas_sync/services/module_item_event_spec.rb +7 -7
- data/spec/dummy/app/models/account.rb +9 -1
- data/spec/dummy/app/models/admin.rb +4 -4
- data/spec/dummy/app/models/assignment.rb +23 -5
- data/spec/dummy/app/models/assignment_group.rb +15 -3
- data/spec/dummy/app/models/context_module.rb +2 -2
- data/spec/dummy/app/models/context_module_item.rb +3 -2
- data/spec/dummy/app/models/course.rb +20 -7
- data/spec/dummy/app/models/enrollment.rb +20 -4
- data/spec/dummy/app/models/role.rb +3 -3
- data/spec/dummy/app/models/section.rb +14 -3
- data/spec/dummy/app/models/submission.rb +16 -4
- data/spec/dummy/app/models/term.rb +4 -3
- data/spec/dummy/app/models/user.rb +15 -4
- data/spec/dummy/app/services/live_events/base_event.rb +4 -0
- data/spec/dummy/app/services/live_events/course_event.rb +1 -1
- data/spec/dummy/app/services/live_events/course_section_event.rb +4 -4
- data/spec/dummy/app/services/live_events/module_event.rb +1 -1
- data/spec/dummy/app/services/live_events/module_item_event.rb +3 -3
- data/spec/dummy/app/services/live_events/user_event.rb +1 -1
- data/spec/dummy/db/migrate/{20180216171618_create_submissions.rb → 20190521003447_create_submissions.rb} +4 -4
- data/spec/dummy/db/migrate/{20180103162102_create_roles.rb → 20190521003448_create_roles.rb} +2 -2
- data/spec/dummy/db/migrate/{20180109210452_create_admins.rb → 20190521003449_create_admins.rb} +2 -2
- data/spec/dummy/db/migrate/{20180222163506_create_assignment_groups.rb → 20190521003450_create_assignment_groups.rb} +2 -2
- data/spec/dummy/db/migrate/{20180411215348_create_context_modules.rb → 20190521003451_create_context_modules.rb} +2 -2
- data/spec/dummy/db/migrate/{20180215214227_create_assignments.rb → 20190603192310_create_assignments.rb} +11 -11
- data/spec/dummy/db/migrate/{20180605172338_create_context_module_items.rb → 20190603193502_create_context_module_items.rb} +4 -4
- data/spec/dummy/db/migrate/{20180509194201_create_users.rb → 20190603215718_create_users.rb} +4 -4
- data/spec/dummy/db/migrate/{20170906193506_create_terms.rb → 20190603215721_create_terms.rb} +2 -2
- data/spec/dummy/db/migrate/{20171107213207_create_sections.rb → 20190603215722_create_sections.rb} +5 -5
- data/spec/dummy/db/migrate/{20170914181345_create_courses.rb → 20190603220011_create_courses.rb} +7 -8
- data/spec/dummy/db/migrate/{20170905192509_create_enrollments.rb → 20190603220013_create_enrollments.rb} +4 -6
- data/spec/dummy/db/migrate/{20180220172559_create_accounts.rb → 20190604193942_create_accounts.rb} +6 -6
- data/spec/dummy/db/schema.rb +56 -58
- data/spec/dummy/log/test.log +1350 -0
- data/spec/factories/account_factory.rb +5 -5
- data/spec/factories/admin_factory.rb +1 -1
- data/spec/factories/assignment_factory.rb +1 -1
- data/spec/factories/assignment_group_factory.rb +1 -1
- data/spec/factories/context_module_factory.rb +2 -2
- data/spec/factories/context_module_item_factory.rb +1 -1
- data/spec/factories/course_factory.rb +5 -5
- data/spec/factories/enrollment_factory.rb +1 -1
- data/spec/factories/role_factory.rb +1 -1
- data/spec/factories/section_factory.rb +1 -1
- data/spec/factories/submission_factory.rb +1 -1
- data/spec/factories/term_factory.rb +1 -1
- data/spec/factories/user_factory.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +41 -41
- data/lib/canvas_sync/generators/templates/models/create_accounts.rb +0 -17
@@ -1,10 +1,10 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :account do
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
canvas_id { SecureRandom.random_number(100_000_000) }
|
4
|
+
sis_id { SecureRandom.hex }
|
5
|
+
canvas_parent_account_id 1
|
6
|
+
sis_parent_account_id { SecureRandom.hex }
|
7
7
|
name "Account name"
|
8
|
-
|
8
|
+
workflow_state "active"
|
9
9
|
end
|
10
10
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :admin do
|
3
|
-
|
3
|
+
canvas_id { SecureRandom.random_number(100_000_000) }
|
4
4
|
role_name 'Cool Role'
|
5
5
|
canvas_role_id { SecureRandom.random_number(100_000_000) }
|
6
6
|
user_data { "{ 'id': 1}" }
|
@@ -1,8 +1,8 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :context_module do
|
3
|
-
sequence(:
|
3
|
+
sequence(:canvas_id) { |n| n }
|
4
4
|
name "Context Module"
|
5
5
|
workflow_state "available"
|
6
|
-
|
6
|
+
context { FactoryGirl.create(:course) }
|
7
7
|
end
|
8
8
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
factory :course do
|
3
|
-
|
3
|
+
canvas_id { SecureRandom.random_number(100_000_000) }
|
4
4
|
sis_id { SecureRandom.hex }
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
course_code 'Cool Course'
|
6
|
+
name 'Really Really Cool Course'
|
7
|
+
start_at { 3.days.ago }
|
8
|
+
end_at { 3.weeks.from_now }
|
9
9
|
end
|
10
10
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
ENV["RAILS_ENV"] ||= 'test'
|
2
2
|
require "canvas_sync"
|
3
3
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
4
|
+
# Rails::Generators.invoke("canvas_sync:install", ["--models", "all"], destination_root: Rails.root)
|
4
5
|
require "bundler/setup"
|
5
6
|
require 'rspec/rails'
|
6
7
|
require 'spec_helper'
|
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.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -325,6 +325,19 @@ files:
|
|
325
325
|
- lib/canvas_sync/engine.rb
|
326
326
|
- lib/canvas_sync/generators/install_generator.rb
|
327
327
|
- lib/canvas_sync/generators/install_live_events_generator.rb
|
328
|
+
- lib/canvas_sync/generators/templates/migrations/create_accounts.rb
|
329
|
+
- lib/canvas_sync/generators/templates/migrations/create_admins.rb
|
330
|
+
- lib/canvas_sync/generators/templates/migrations/create_assignment_groups.rb
|
331
|
+
- lib/canvas_sync/generators/templates/migrations/create_assignments.rb
|
332
|
+
- lib/canvas_sync/generators/templates/migrations/create_context_module_items.rb
|
333
|
+
- lib/canvas_sync/generators/templates/migrations/create_context_modules.rb
|
334
|
+
- lib/canvas_sync/generators/templates/migrations/create_courses.rb
|
335
|
+
- lib/canvas_sync/generators/templates/migrations/create_enrollments.rb
|
336
|
+
- lib/canvas_sync/generators/templates/migrations/create_roles.rb
|
337
|
+
- lib/canvas_sync/generators/templates/migrations/create_sections.rb
|
338
|
+
- lib/canvas_sync/generators/templates/migrations/create_submissions.rb
|
339
|
+
- lib/canvas_sync/generators/templates/migrations/create_terms.rb
|
340
|
+
- lib/canvas_sync/generators/templates/migrations/create_users.rb
|
328
341
|
- lib/canvas_sync/generators/templates/models/account.rb
|
329
342
|
- lib/canvas_sync/generators/templates/models/admin.rb
|
330
343
|
- lib/canvas_sync/generators/templates/models/assignment.rb
|
@@ -332,19 +345,6 @@ files:
|
|
332
345
|
- lib/canvas_sync/generators/templates/models/context_module.rb
|
333
346
|
- lib/canvas_sync/generators/templates/models/context_module_item.rb
|
334
347
|
- lib/canvas_sync/generators/templates/models/course.rb
|
335
|
-
- lib/canvas_sync/generators/templates/models/create_accounts.rb
|
336
|
-
- lib/canvas_sync/generators/templates/models/create_admins.rb
|
337
|
-
- lib/canvas_sync/generators/templates/models/create_assignment_groups.rb
|
338
|
-
- lib/canvas_sync/generators/templates/models/create_assignments.rb
|
339
|
-
- lib/canvas_sync/generators/templates/models/create_context_module_items.rb
|
340
|
-
- lib/canvas_sync/generators/templates/models/create_context_modules.rb
|
341
|
-
- lib/canvas_sync/generators/templates/models/create_courses.rb
|
342
|
-
- lib/canvas_sync/generators/templates/models/create_enrollments.rb
|
343
|
-
- lib/canvas_sync/generators/templates/models/create_roles.rb
|
344
|
-
- lib/canvas_sync/generators/templates/models/create_sections.rb
|
345
|
-
- lib/canvas_sync/generators/templates/models/create_submissions.rb
|
346
|
-
- lib/canvas_sync/generators/templates/models/create_terms.rb
|
347
|
-
- lib/canvas_sync/generators/templates/models/create_users.rb
|
348
348
|
- lib/canvas_sync/generators/templates/models/enrollment.rb
|
349
349
|
- lib/canvas_sync/generators/templates/models/role.rb
|
350
350
|
- lib/canvas_sync/generators/templates/models/section.rb
|
@@ -504,19 +504,19 @@ files:
|
|
504
504
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
505
505
|
- spec/dummy/config/routes.rb
|
506
506
|
- spec/dummy/config/secrets.yml
|
507
|
-
- spec/dummy/db/migrate/
|
508
|
-
- spec/dummy/db/migrate/
|
509
|
-
- spec/dummy/db/migrate/
|
510
|
-
- spec/dummy/db/migrate/
|
511
|
-
- spec/dummy/db/migrate/
|
512
|
-
- spec/dummy/db/migrate/
|
513
|
-
- spec/dummy/db/migrate/
|
514
|
-
- spec/dummy/db/migrate/
|
515
|
-
- spec/dummy/db/migrate/
|
516
|
-
- spec/dummy/db/migrate/
|
517
|
-
- spec/dummy/db/migrate/
|
518
|
-
- spec/dummy/db/migrate/
|
519
|
-
- spec/dummy/db/migrate/
|
507
|
+
- spec/dummy/db/migrate/20190521003447_create_submissions.rb
|
508
|
+
- spec/dummy/db/migrate/20190521003448_create_roles.rb
|
509
|
+
- spec/dummy/db/migrate/20190521003449_create_admins.rb
|
510
|
+
- spec/dummy/db/migrate/20190521003450_create_assignment_groups.rb
|
511
|
+
- spec/dummy/db/migrate/20190521003451_create_context_modules.rb
|
512
|
+
- spec/dummy/db/migrate/20190603192310_create_assignments.rb
|
513
|
+
- spec/dummy/db/migrate/20190603193502_create_context_module_items.rb
|
514
|
+
- spec/dummy/db/migrate/20190603215718_create_users.rb
|
515
|
+
- spec/dummy/db/migrate/20190603215721_create_terms.rb
|
516
|
+
- spec/dummy/db/migrate/20190603215722_create_sections.rb
|
517
|
+
- spec/dummy/db/migrate/20190603220011_create_courses.rb
|
518
|
+
- spec/dummy/db/migrate/20190603220013_create_enrollments.rb
|
519
|
+
- spec/dummy/db/migrate/20190604193942_create_accounts.rb
|
520
520
|
- spec/dummy/db/schema.rb
|
521
521
|
- spec/dummy/db/test.sqlite3
|
522
522
|
- spec/dummy/log/development.log
|
@@ -673,19 +673,19 @@ test_files:
|
|
673
673
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
674
674
|
- spec/dummy/config/routes.rb
|
675
675
|
- spec/dummy/config/secrets.yml
|
676
|
-
- spec/dummy/db/migrate/
|
677
|
-
- spec/dummy/db/migrate/
|
678
|
-
- spec/dummy/db/migrate/
|
679
|
-
- spec/dummy/db/migrate/
|
680
|
-
- spec/dummy/db/migrate/
|
681
|
-
- spec/dummy/db/migrate/
|
682
|
-
- spec/dummy/db/migrate/
|
683
|
-
- spec/dummy/db/migrate/
|
684
|
-
- spec/dummy/db/migrate/
|
685
|
-
- spec/dummy/db/migrate/
|
686
|
-
- spec/dummy/db/migrate/
|
687
|
-
- spec/dummy/db/migrate/
|
688
|
-
- spec/dummy/db/migrate/
|
676
|
+
- spec/dummy/db/migrate/20190521003447_create_submissions.rb
|
677
|
+
- spec/dummy/db/migrate/20190521003448_create_roles.rb
|
678
|
+
- spec/dummy/db/migrate/20190521003449_create_admins.rb
|
679
|
+
- spec/dummy/db/migrate/20190521003450_create_assignment_groups.rb
|
680
|
+
- spec/dummy/db/migrate/20190521003451_create_context_modules.rb
|
681
|
+
- spec/dummy/db/migrate/20190603192310_create_assignments.rb
|
682
|
+
- spec/dummy/db/migrate/20190603193502_create_context_module_items.rb
|
683
|
+
- spec/dummy/db/migrate/20190603215718_create_users.rb
|
684
|
+
- spec/dummy/db/migrate/20190603215721_create_terms.rb
|
685
|
+
- spec/dummy/db/migrate/20190603215722_create_sections.rb
|
686
|
+
- spec/dummy/db/migrate/20190603220011_create_courses.rb
|
687
|
+
- spec/dummy/db/migrate/20190603220013_create_enrollments.rb
|
688
|
+
- spec/dummy/db/migrate/20190604193942_create_accounts.rb
|
689
689
|
- spec/dummy/db/schema.rb
|
690
690
|
- spec/dummy/db/test.sqlite3
|
691
691
|
- spec/dummy/log/development.log
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<%= autogenerated_migration_warning %>
|
2
|
-
|
3
|
-
class CreateAccounts < ActiveRecord::Migration[5.1]
|
4
|
-
def change
|
5
|
-
create_table :accounts do |t|
|
6
|
-
t.bigint :canvas_account_id, null: false
|
7
|
-
t.string :account_id
|
8
|
-
t.bigint :canvas_parent_id
|
9
|
-
t.string :parent_account_id
|
10
|
-
t.string :name
|
11
|
-
t.string :status
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
add_index :accounts, :canvas_account_id, unique: true
|
16
|
-
end
|
17
|
-
end
|