canvas_sync 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +5 -5
  2. data/lib/canvas_sync/generators/install_live_events_generator.rb +5 -1
  3. data/lib/canvas_sync/generators/templates/migrations/create_accounts.rb +1 -1
  4. data/lib/canvas_sync/generators/templates/migrations/create_admins.rb +1 -1
  5. data/lib/canvas_sync/generators/templates/migrations/create_assignment_groups.rb +1 -1
  6. data/lib/canvas_sync/generators/templates/migrations/create_assignments.rb +1 -1
  7. data/lib/canvas_sync/generators/templates/migrations/create_context_module_items.rb +1 -1
  8. data/lib/canvas_sync/generators/templates/migrations/create_context_modules.rb +1 -1
  9. data/lib/canvas_sync/generators/templates/migrations/create_courses.rb +1 -1
  10. data/lib/canvas_sync/generators/templates/migrations/create_enrollments.rb +1 -1
  11. data/lib/canvas_sync/generators/templates/migrations/create_roles.rb +1 -1
  12. data/lib/canvas_sync/generators/templates/migrations/create_sections.rb +1 -1
  13. data/lib/canvas_sync/generators/templates/migrations/create_submissions.rb +1 -1
  14. data/lib/canvas_sync/generators/templates/migrations/create_terms.rb +1 -1
  15. data/lib/canvas_sync/generators/templates/migrations/create_users.rb +1 -1
  16. data/lib/canvas_sync/generators/templates/models/account.rb +1 -1
  17. data/lib/canvas_sync/generators/templates/models/admin.rb +1 -1
  18. data/lib/canvas_sync/generators/templates/models/assignment.rb +1 -1
  19. data/lib/canvas_sync/generators/templates/models/assignment_group.rb +1 -1
  20. data/lib/canvas_sync/generators/templates/models/context_module.rb +8 -1
  21. data/lib/canvas_sync/generators/templates/models/context_module_item.rb +8 -1
  22. data/lib/canvas_sync/generators/templates/models/course.rb +1 -1
  23. data/lib/canvas_sync/generators/templates/models/enrollment.rb +1 -1
  24. data/lib/canvas_sync/generators/templates/models/role.rb +1 -1
  25. data/lib/canvas_sync/generators/templates/models/section.rb +2 -1
  26. data/lib/canvas_sync/generators/templates/models/submission.rb +1 -1
  27. data/lib/canvas_sync/generators/templates/models/term.rb +1 -1
  28. data/lib/canvas_sync/generators/templates/models/user.rb +1 -1
  29. data/lib/canvas_sync/generators/templates/services/live_events/assignment_event.rb +33 -0
  30. data/lib/canvas_sync/generators/templates/services/live_events/assignment_group_event.rb +24 -0
  31. data/lib/canvas_sync/generators/templates/services/live_events/base_event.rb +22 -0
  32. data/lib/canvas_sync/generators/templates/services/live_events/course_event.rb +20 -0
  33. data/lib/canvas_sync/generators/templates/services/live_events/course_section_event.rb +18 -0
  34. data/lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb +20 -0
  35. data/lib/canvas_sync/generators/templates/services/live_events/grade_event.rb +26 -0
  36. data/lib/canvas_sync/generators/templates/services/live_events/module_event.rb +16 -0
  37. data/lib/canvas_sync/generators/templates/services/live_events/module_item_event.rb +15 -0
  38. data/lib/canvas_sync/generators/templates/services/live_events/submission_event.rb +18 -0
  39. data/lib/canvas_sync/generators/templates/services/live_events/syllabus_event.rb +21 -0
  40. data/lib/canvas_sync/generators/templates/services/live_events/user_event.rb +19 -0
  41. data/lib/canvas_sync/version.rb +1 -1
  42. data/spec/canvas_sync/services/module_event_spec.rb +2 -2
  43. data/spec/canvas_sync/services/module_item_event_spec.rb +2 -2
  44. data/spec/dummy/app/models/account.rb +1 -1
  45. data/spec/dummy/app/models/admin.rb +1 -1
  46. data/spec/dummy/app/models/assignment.rb +1 -1
  47. data/spec/dummy/app/models/assignment_group.rb +3 -2
  48. data/spec/dummy/app/models/context_module.rb +8 -1
  49. data/spec/dummy/app/models/context_module_item.rb +8 -1
  50. data/spec/dummy/app/models/course.rb +1 -1
  51. data/spec/dummy/app/models/enrollment.rb +1 -1
  52. data/spec/dummy/app/models/role.rb +1 -1
  53. data/spec/dummy/app/models/section.rb +2 -1
  54. data/spec/dummy/app/models/submission.rb +1 -1
  55. data/spec/dummy/app/models/term.rb +1 -1
  56. data/spec/dummy/app/models/user.rb +1 -1
  57. data/spec/dummy/app/services/live_events/assignment_event.rb +19 -36
  58. data/spec/dummy/app/services/live_events/base_event.rb +26 -0
  59. data/spec/dummy/app/services/live_events/course_event.rb +15 -27
  60. data/spec/dummy/app/services/live_events/course_section_event.rb +13 -39
  61. data/spec/dummy/app/services/live_events/enrollment_event.rb +17 -48
  62. data/spec/dummy/app/services/live_events/grade_event.rb +9 -34
  63. data/spec/dummy/app/services/live_events/module_event.rb +10 -29
  64. data/spec/dummy/app/services/live_events/module_item_event.rb +10 -28
  65. data/spec/dummy/app/services/live_events/submission_event.rb +12 -42
  66. data/spec/dummy/app/services/live_events/syllabus_event.rb +11 -20
  67. data/spec/dummy/app/services/live_events/user_event.rb +14 -25
  68. data/spec/dummy/db/migrate/{20190603215718_create_users.rb → 20190702203620_create_users.rb} +1 -1
  69. data/spec/dummy/db/migrate/{20190603220011_create_courses.rb → 20190702203621_create_courses.rb} +1 -1
  70. data/spec/dummy/db/migrate/{20190604193942_create_accounts.rb → 20190702203622_create_accounts.rb} +1 -1
  71. data/spec/dummy/db/migrate/{20190603215721_create_terms.rb → 20190702203623_create_terms.rb} +1 -1
  72. data/spec/dummy/db/migrate/{20190603220013_create_enrollments.rb → 20190702203624_create_enrollments.rb} +1 -1
  73. data/spec/dummy/db/migrate/{20190603215722_create_sections.rb → 20190702203625_create_sections.rb} +1 -1
  74. data/spec/dummy/db/migrate/{20190603192310_create_assignments.rb → 20190702203626_create_assignments.rb} +1 -1
  75. data/spec/dummy/db/migrate/{20190521003447_create_submissions.rb → 20190702203627_create_submissions.rb} +1 -1
  76. data/spec/dummy/db/migrate/{20190606161037_create_roles.rb → 20190702203628_create_roles.rb} +1 -1
  77. data/spec/dummy/db/migrate/{20190521003449_create_admins.rb → 20190702203629_create_admins.rb} +1 -1
  78. data/spec/dummy/db/migrate/{20190521003450_create_assignment_groups.rb → 20190702203630_create_assignment_groups.rb} +1 -1
  79. data/spec/dummy/db/migrate/{20190521003451_create_context_modules.rb → 20190702203631_create_context_modules.rb} +1 -1
  80. data/spec/dummy/db/migrate/{20190603193502_create_context_module_items.rb → 20190702203632_create_context_module_items.rb} +1 -1
  81. data/spec/dummy/db/schema.rb +1 -1
  82. metadata +41 -67
  83. data/lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_created_event.rb +0 -6
  84. data/lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_event.rb +0 -54
  85. data/lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_updated_event.rb +0 -6
  86. data/lib/canvas_sync/generators/templates/services/live_events/course/course_created_event.rb +0 -6
  87. data/lib/canvas_sync/generators/templates/services/live_events/course/course_event.rb +0 -36
  88. data/lib/canvas_sync/generators/templates/services/live_events/course/course_updated_event.rb +0 -6
  89. data/lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_created_event.rb +0 -6
  90. data/lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_event.rb +0 -48
  91. data/lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_updated_event.rb +0 -6
  92. data/lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_created_event.rb +0 -6
  93. data/lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_event.rb +0 -55
  94. data/lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_updated_event.rb +0 -6
  95. data/lib/canvas_sync/generators/templates/services/live_events/grade/grade_changed_event.rb +0 -6
  96. data/lib/canvas_sync/generators/templates/services/live_events/grade/grade_event.rb +0 -55
  97. data/lib/canvas_sync/generators/templates/services/live_events/module/module_created_event.rb +0 -6
  98. data/lib/canvas_sync/generators/templates/services/live_events/module/module_event.rb +0 -39
  99. data/lib/canvas_sync/generators/templates/services/live_events/module/module_updated_event.rb +0 -6
  100. data/lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_created_event.rb +0 -6
  101. data/lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_event.rb +0 -37
  102. data/lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_updated_event.rb +0 -6
  103. data/lib/canvas_sync/generators/templates/services/live_events/submission/submission_created_event.rb +0 -6
  104. data/lib/canvas_sync/generators/templates/services/live_events/submission/submission_event.rb +0 -52
  105. data/lib/canvas_sync/generators/templates/services/live_events/submission/submission_updated_event.rb +0 -6
  106. data/lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_event.rb +0 -34
  107. data/lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_updated_event.rb +0 -6
  108. data/lib/canvas_sync/generators/templates/services/live_events/user/user_created_event.rb +0 -6
  109. data/lib/canvas_sync/generators/templates/services/live_events/user/user_event.rb +0 -34
  110. data/lib/canvas_sync/generators/templates/services/live_events/user/user_updated_event.rb +0 -6
  111. data/spec/dummy/db/test.sqlite3 +0 -0
  112. data/spec/dummy/log/development.log +0 -1248
  113. data/spec/dummy/log/test.log +0 -43258
  114. data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +0 -3
  115. data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +0 -4
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -1,4 +1,4 @@
1
- #
1
+ # #
2
2
  # AUTO GENERATED MIGRATION
3
3
  # This migration was auto generated by the CanvasSync Gem.
4
4
  # You can add new columns to this table, but removing or
@@ -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: 20190606161037) do
13
+ ActiveRecord::Schema.define(version: 20190702203632) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
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.10.2
4
+ version: 0.10.3
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-06-20 00:00:00.000000000 Z
11
+ date: 2019-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -351,35 +351,18 @@ files:
351
351
  - lib/canvas_sync/generators/templates/models/submission.rb
352
352
  - lib/canvas_sync/generators/templates/models/term.rb
353
353
  - lib/canvas_sync/generators/templates/models/user.rb
354
- - lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_created_event.rb
355
- - lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_event.rb
356
- - lib/canvas_sync/generators/templates/services/live_events/assignment/assignment_updated_event.rb
354
+ - lib/canvas_sync/generators/templates/services/live_events/assignment_event.rb
355
+ - lib/canvas_sync/generators/templates/services/live_events/assignment_group_event.rb
357
356
  - lib/canvas_sync/generators/templates/services/live_events/base_event.rb
358
- - lib/canvas_sync/generators/templates/services/live_events/course/course_created_event.rb
359
- - lib/canvas_sync/generators/templates/services/live_events/course/course_event.rb
360
- - lib/canvas_sync/generators/templates/services/live_events/course/course_updated_event.rb
361
- - lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_created_event.rb
362
- - lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_event.rb
363
- - lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_updated_event.rb
364
- - lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_created_event.rb
365
- - lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_event.rb
366
- - lib/canvas_sync/generators/templates/services/live_events/enrollment/enrollment_updated_event.rb
367
- - lib/canvas_sync/generators/templates/services/live_events/grade/grade_changed_event.rb
368
- - lib/canvas_sync/generators/templates/services/live_events/grade/grade_event.rb
369
- - lib/canvas_sync/generators/templates/services/live_events/module/module_created_event.rb
370
- - lib/canvas_sync/generators/templates/services/live_events/module/module_event.rb
371
- - lib/canvas_sync/generators/templates/services/live_events/module/module_updated_event.rb
372
- - lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_created_event.rb
373
- - lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_event.rb
374
- - lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_updated_event.rb
375
- - lib/canvas_sync/generators/templates/services/live_events/submission/submission_created_event.rb
376
- - lib/canvas_sync/generators/templates/services/live_events/submission/submission_event.rb
377
- - lib/canvas_sync/generators/templates/services/live_events/submission/submission_updated_event.rb
378
- - lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_event.rb
379
- - lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_updated_event.rb
380
- - lib/canvas_sync/generators/templates/services/live_events/user/user_created_event.rb
381
- - lib/canvas_sync/generators/templates/services/live_events/user/user_event.rb
382
- - lib/canvas_sync/generators/templates/services/live_events/user/user_updated_event.rb
357
+ - lib/canvas_sync/generators/templates/services/live_events/course_event.rb
358
+ - lib/canvas_sync/generators/templates/services/live_events/course_section_event.rb
359
+ - lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb
360
+ - lib/canvas_sync/generators/templates/services/live_events/grade_event.rb
361
+ - lib/canvas_sync/generators/templates/services/live_events/module_event.rb
362
+ - lib/canvas_sync/generators/templates/services/live_events/module_item_event.rb
363
+ - lib/canvas_sync/generators/templates/services/live_events/submission_event.rb
364
+ - lib/canvas_sync/generators/templates/services/live_events/syllabus_event.rb
365
+ - lib/canvas_sync/generators/templates/services/live_events/user_event.rb
383
366
  - lib/canvas_sync/importers/bulk_importer.rb
384
367
  - lib/canvas_sync/importers/legacy_importer.rb
385
368
  - lib/canvas_sync/job.rb
@@ -504,23 +487,20 @@ files:
504
487
  - spec/dummy/config/initializers/wrap_parameters.rb
505
488
  - spec/dummy/config/routes.rb
506
489
  - spec/dummy/config/secrets.yml
507
- - spec/dummy/db/migrate/20190521003447_create_submissions.rb
508
- - spec/dummy/db/migrate/20190521003449_create_admins.rb
509
- - spec/dummy/db/migrate/20190521003450_create_assignment_groups.rb
510
- - spec/dummy/db/migrate/20190521003451_create_context_modules.rb
511
- - spec/dummy/db/migrate/20190603192310_create_assignments.rb
512
- - spec/dummy/db/migrate/20190603193502_create_context_module_items.rb
513
- - spec/dummy/db/migrate/20190603215718_create_users.rb
514
- - spec/dummy/db/migrate/20190603215721_create_terms.rb
515
- - spec/dummy/db/migrate/20190603215722_create_sections.rb
516
- - spec/dummy/db/migrate/20190603220011_create_courses.rb
517
- - spec/dummy/db/migrate/20190603220013_create_enrollments.rb
518
- - spec/dummy/db/migrate/20190604193942_create_accounts.rb
519
- - spec/dummy/db/migrate/20190606161037_create_roles.rb
490
+ - spec/dummy/db/migrate/20190702203620_create_users.rb
491
+ - spec/dummy/db/migrate/20190702203621_create_courses.rb
492
+ - spec/dummy/db/migrate/20190702203622_create_accounts.rb
493
+ - spec/dummy/db/migrate/20190702203623_create_terms.rb
494
+ - spec/dummy/db/migrate/20190702203624_create_enrollments.rb
495
+ - spec/dummy/db/migrate/20190702203625_create_sections.rb
496
+ - spec/dummy/db/migrate/20190702203626_create_assignments.rb
497
+ - spec/dummy/db/migrate/20190702203627_create_submissions.rb
498
+ - spec/dummy/db/migrate/20190702203628_create_roles.rb
499
+ - spec/dummy/db/migrate/20190702203629_create_admins.rb
500
+ - spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
501
+ - spec/dummy/db/migrate/20190702203631_create_context_modules.rb
502
+ - spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
520
503
  - spec/dummy/db/schema.rb
521
- - spec/dummy/db/test.sqlite3
522
- - spec/dummy/log/development.log
523
- - spec/dummy/log/test.log
524
504
  - spec/factories/account_factory.rb
525
505
  - spec/factories/admin_factory.rb
526
506
  - spec/factories/assignment_factory.rb
@@ -548,8 +528,6 @@ files:
548
528
  - spec/support/fixtures/reports/courses.csv
549
529
  - spec/support/fixtures/reports/enrollments.csv
550
530
  - spec/support/fixtures/reports/provisioning_csv
551
- - spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
552
- - spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
553
531
  - spec/support/fixtures/reports/sections.csv
554
532
  - spec/support/fixtures/reports/submissions.csv
555
533
  - spec/support/fixtures/reports/users.csv
@@ -572,7 +550,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
572
550
  - !ruby/object:Gem::Version
573
551
  version: '0'
574
552
  requirements: []
575
- rubygems_version: 3.0.3
553
+ rubyforge_project:
554
+ rubygems_version: 2.5.2.1
576
555
  signing_key:
577
556
  specification_version: 4
578
557
  summary: Gem for generating Canvas models and migrations and syncing data from Canvas
@@ -673,23 +652,20 @@ test_files:
673
652
  - spec/dummy/config/initializers/wrap_parameters.rb
674
653
  - spec/dummy/config/routes.rb
675
654
  - spec/dummy/config/secrets.yml
676
- - spec/dummy/db/migrate/20190521003447_create_submissions.rb
677
- - spec/dummy/db/migrate/20190521003449_create_admins.rb
678
- - spec/dummy/db/migrate/20190521003450_create_assignment_groups.rb
679
- - spec/dummy/db/migrate/20190521003451_create_context_modules.rb
680
- - spec/dummy/db/migrate/20190603192310_create_assignments.rb
681
- - spec/dummy/db/migrate/20190603193502_create_context_module_items.rb
682
- - spec/dummy/db/migrate/20190603215718_create_users.rb
683
- - spec/dummy/db/migrate/20190603215721_create_terms.rb
684
- - spec/dummy/db/migrate/20190603215722_create_sections.rb
685
- - spec/dummy/db/migrate/20190603220011_create_courses.rb
686
- - spec/dummy/db/migrate/20190603220013_create_enrollments.rb
687
- - spec/dummy/db/migrate/20190604193942_create_accounts.rb
688
- - spec/dummy/db/migrate/20190606161037_create_roles.rb
655
+ - spec/dummy/db/migrate/20190702203620_create_users.rb
656
+ - spec/dummy/db/migrate/20190702203621_create_courses.rb
657
+ - spec/dummy/db/migrate/20190702203622_create_accounts.rb
658
+ - spec/dummy/db/migrate/20190702203623_create_terms.rb
659
+ - spec/dummy/db/migrate/20190702203624_create_enrollments.rb
660
+ - spec/dummy/db/migrate/20190702203625_create_sections.rb
661
+ - spec/dummy/db/migrate/20190702203626_create_assignments.rb
662
+ - spec/dummy/db/migrate/20190702203627_create_submissions.rb
663
+ - spec/dummy/db/migrate/20190702203628_create_roles.rb
664
+ - spec/dummy/db/migrate/20190702203629_create_admins.rb
665
+ - spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
666
+ - spec/dummy/db/migrate/20190702203631_create_context_modules.rb
667
+ - spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
689
668
  - spec/dummy/db/schema.rb
690
- - spec/dummy/db/test.sqlite3
691
- - spec/dummy/log/development.log
692
- - spec/dummy/log/test.log
693
669
  - spec/factories/account_factory.rb
694
670
  - spec/factories/admin_factory.rb
695
671
  - spec/factories/assignment_factory.rb
@@ -717,8 +693,6 @@ test_files:
717
693
  - spec/support/fixtures/reports/courses.csv
718
694
  - spec/support/fixtures/reports/enrollments.csv
719
695
  - spec/support/fixtures/reports/provisioning_csv
720
- - spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
721
- - spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
722
696
  - spec/support/fixtures/reports/sections.csv
723
697
  - spec/support/fixtures/reports/submissions.csv
724
698
  - spec/support/fixtures/reports/users.csv
@@ -1,6 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class AssignmentCreatedEvent < LiveEvents::AssignmentEvent
5
- end
6
- end
@@ -1,54 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class AssignmentEvent < LiveEvents::BaseEvent
5
- # The following is provided in the live events call:
6
- # {
7
- # assignment_id: assignment.global_id,
8
- # context_id: assignment.global_context_id,
9
- # context_type: assignment.context_type,
10
- # workflow_state: assignment.workflow_state,
11
- # title: LiveEvents.truncate(assignment.title),
12
- # description: LiveEvents.truncate(assignment.description),
13
- # due_at: assignment.due_at,
14
- # unlock_at: assignment.unlock_at,
15
- # lock_at: assignment.lock_at,
16
- # updated_at: assignment.updated_at,
17
- # points_possible: assignment.points_possible
18
- # }
19
-
20
- def perform(event_payload)
21
- super
22
- attrs = {
23
- canvas_assignment_id: local_canvas_id(payload[:assignment_id]),
24
- title: payload[:title],
25
- workflow_state: payload[:workflow_state],
26
- description: payload[:description],
27
- due_at: payload[:due_at],
28
- unlock_at: payload[:unlock_at],
29
- lock_at: payload[:lock_at],
30
- points_possible: payload[:points_possible],
31
- }
32
- create_or_update(attrs)
33
- end
34
-
35
- private
36
-
37
- def create_or_update(attrs)
38
- assignment = Assignment.where(canvas_assignment_id: attrs[:canvas_assignment_id]).first_or_initialize
39
- assignment.assign_attributes(attrs)
40
- assignment.save!
41
- assignment
42
- end
43
-
44
- # This could be nil if the context type for this assignment is not 'Course' of if a local course was not found
45
- def canvas_course_id
46
- payload[:context_type] == "Course" ? local_canvas_id(payload[:context_id]) : nil
47
- end
48
-
49
- # This could be nil if the context type for this assignment is not 'Course' of if a local course was not found
50
- def course
51
- @course ||= Course.find_by(canvas_course_id: canvas_course_id)
52
- end
53
- end
54
- end
@@ -1,6 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class AssignmentUpdatedEvent < LiveEvents::AssignmentEvent
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class CourseCreatedEvent < LiveEvents::CourseEvent
5
- end
6
- end
@@ -1,36 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class CourseEvent < LiveEvents::BaseEvent
5
- # The following is provided in the live events call:
6
- # {
7
- # course_id: course.global_id,
8
- # uuid: course.uuid,
9
- # account_id: course.global_account_id,
10
- # name: course.name,
11
- # created_at: course.created_at,
12
- # updated_at: course.updated_at,
13
- # workflow_state: course.workflow_state
14
- # }
15
-
16
- def perform(event_payload)
17
- super
18
- attrs = {
19
- canvas_course_id: local_canvas_id(payload[:course_id]),
20
- canvas_account_id: local_canvas_id(payload[:account_id]),
21
- name: payload[:name],
22
- status: payload[:workflow_state],
23
- }
24
- create_or_update(attrs)
25
- end
26
-
27
- private
28
-
29
- def create_or_update(attrs)
30
- course = Course.where(canvas_course_id: attrs[:canvas_course_id]).first_or_initialize
31
- course.assign_attributes(attrs)
32
- course.save!
33
- course
34
- end
35
- end
36
- end
@@ -1,6 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class CourseUpdatedEvent < LiveEvents::CourseEvent
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class CourseSectionCreatedEvent < LiveEvents::CourseSectionEvent
5
- end
6
- end
@@ -1,48 +0,0 @@
1
- # <%= autogenerated_event_warning %>
2
-
3
- module LiveEvents
4
- class CourseSectionEvent < LiveEvents::BaseEvent
5
- # The following is provided in the live events call:
6
- # {
7
- # course_section_id: section.id,
8
- # sis_id: section.sis_id,
9
- # sis_batch_id: section.sis_batch_id,
10
- # course_id: section.course_id,
11
- # root_account_id: section.root_account_id,
12
- # enrollment_term_id: section.enrollment_term_id,
13
- # name: section.name,
14
- # default_section: section.default_section,
15
- # accepting_enrollments: section.accepting_enrollments,
16
- # can_manually_enroll: section.can_manually_enroll,
17
- # start_at: section.start_at,
18
- # end_at: section.end_at,
19
- # workflow_state: section.workflow_state,
20
- # restrict_enrollments_to_section_dates: section.restrict_enrollments_to_section_dates,
21
- # nonxlist_course_id: section.nonxlist_course_id,
22
- # stuck_sis_fields: section.stuck_sis_fields,
23
- # integration_id: section.integration_id
24
- # }
25
-
26
- def perform(_event_payload)
27
- super
28
- attrs = {
29
- canvas_section_id: local_canvas_id(payload[:course_section_id]),
30
- canvas_course_id: local_canvas_id(payload[:course_id]),
31
- name: payload[:name],
32
- workflow_state: payload[:workflow_state],
33
- start_at: payload[:start_at],
34
- end_at: payload[:end_at],
35
- canvas_nonxlist_course_id: payload[:nonxlist_course_id],
36
- }
37
- create_or_update(attrs)
38
- end
39
-
40
- private
41
-
42
- def create_or_update(attrs)
43
- section = Section.where(canvas_section_id: attrs[:canvas_section_id]).first_or_initialize
44
- section.assign_attributes(attrs)
45
- section.save!
46
- end
47
- end
48
- end