canvas_sync 0.27.13 → 0.27.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/canvas_sync/api/v1/health_check_controller.rb +0 -0
- data/app/models/canvas_sync/job_log.rb +0 -0
- data/app/models/canvas_sync/sync_batch.rb +0 -0
- data/config/initializers/apartment.rb +0 -0
- data/config/routes.rb +0 -0
- data/db/migrate/20170915210836_create_canvas_sync_job_log.rb +0 -0
- data/db/migrate/20180725155729_add_job_id_to_canvas_sync_job_logs.rb +0 -0
- data/db/migrate/20190916154829_add_fork_count_to_canvas_sync_job_logs.rb +0 -0
- data/db/migrate/20201018210836_create_canvas_sync_sync_batches.rb +0 -0
- data/db/migrate/20201030210836_add_full_sync_to_canvas_sync_sync_batch.rb +0 -0
- data/lib/canvas_sync/api_syncable.rb +0 -0
- data/lib/canvas_sync/batch_processor.rb +0 -0
- data/lib/canvas_sync/class_callback_executor.rb +0 -0
- data/lib/canvas_sync/concerns/ability_helper.rb +43 -2
- data/lib/canvas_sync/concerns/account/ancestry.rb +0 -0
- data/lib/canvas_sync/concerns/account/base.rb +0 -0
- data/lib/canvas_sync/concerns/api_syncable.rb +0 -0
- data/lib/canvas_sync/concerns/canvas_id_as_primary.rb +0 -0
- data/lib/canvas_sync/concerns/jit_syncing.rb +0 -0
- data/lib/canvas_sync/concerns/legacy_columns.rb +0 -0
- data/lib/canvas_sync/concerns/role/base.rb +0 -0
- data/lib/canvas_sync/generators/install_generator.rb +0 -0
- data/lib/canvas_sync/generators/install_live_events_generator.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_accounts.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_admins.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_assignment_groups.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_assignments.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_content_migrations.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_context_module_items.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_context_modules.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_course_nicknames.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_course_progresses.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_grading_period_groups.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_grading_periods.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_group_memberships.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_groups.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_learning_outcome_results.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_learning_outcomes.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_pseudonyms.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubric_assessments.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubric_associations.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubrics.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_sections.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_submissions.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_terms.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_user_observers.rb +0 -0
- data/lib/canvas_sync/generators/templates/migrations/create_users.rb +0 -0
- data/lib/canvas_sync/generators/templates/models/content_migration.rb +0 -0
- data/lib/canvas_sync/generators/templates/models/course_nickname.rb +0 -0
- data/lib/canvas_sync/generators/templates/models/rubric.rb +0 -0
- data/lib/canvas_sync/generators/templates/models/rubric_assessment.rb +0 -0
- data/lib/canvas_sync/generators/templates/models/rubric_association.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/assignment_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/assignment_group_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/course_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/course_section_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/grade_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/module_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/module_item_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/submission_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/syllabus_event.rb +0 -0
- data/lib/canvas_sync/generators/templates/services/live_events/user_event.rb +0 -0
- data/lib/canvas_sync/importers/legacy_importer.rb +0 -0
- data/lib/canvas_sync/jobs/begin_sync_chain_job.rb +0 -0
- data/lib/canvas_sync/jobs/canvas_process_waiter.rb +0 -0
- data/lib/canvas_sync/jobs/sync_admins_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_assignment_groups_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_assignments_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_content_migrations_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_context_module_items_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_context_modules_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_rubrics_job.rb +0 -0
- data/lib/canvas_sync/jobs/sync_simple_table_job.rb +0 -0
- data/lib/canvas_sync/live_events/base_handler.rb +0 -0
- data/lib/canvas_sync/live_events.rb +0 -0
- data/lib/canvas_sync/misc_helper.rb +0 -0
- data/lib/canvas_sync/processors/normal_processor.rb +0 -0
- data/lib/canvas_sync/sidekiq_job.rb +0 -0
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/canvas_sync/concerns/ability_helper_spec.rb +165 -0
- data/spec/canvas_sync/jobs/canvas_process_waiter_spec.rb +0 -0
- data/spec/canvas_sync/jobs/report_starter_spec.rb +0 -0
- data/spec/canvas_sync/jobs/sync_admins_job_spec.rb +0 -0
- data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +0 -0
- data/spec/canvas_sync/jobs/sync_roles_job_spec.rb +0 -0
- data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +0 -0
- data/spec/canvas_sync/jobs/sync_terms_job_spec.rb +0 -0
- data/spec/canvas_sync/live_events/live_event_sync_spec.rb +0 -0
- data/spec/canvas_sync/live_events/live_events_controller_spec.rb +0 -0
- data/spec/canvas_sync/misc_helper_spec.rb +0 -0
- data/spec/canvas_sync/models/accounts_spec.rb +0 -0
- data/spec/canvas_sync/models/admins_spec.rb +0 -0
- data/spec/canvas_sync/models/assignment_group_spec.rb +0 -0
- data/spec/canvas_sync/models/assignment_spec.rb +0 -0
- data/spec/canvas_sync/models/context_module_item_spec.rb +0 -0
- data/spec/canvas_sync/models/context_module_spec.rb +0 -0
- data/spec/canvas_sync/models/course_spec.rb +0 -0
- data/spec/canvas_sync/models/enrollment_spec.rb +0 -0
- data/spec/canvas_sync/models/group_membership_spec.rb +0 -0
- data/spec/canvas_sync/models/group_spec.rb +0 -0
- data/spec/canvas_sync/models/roles_spec.rb +0 -0
- data/spec/canvas_sync/models/section_spec.rb +0 -0
- data/spec/canvas_sync/models/submission_spec.rb +0 -0
- data/spec/canvas_sync/models/term_spec.rb +0 -0
- data/spec/canvas_sync/models/user_spec.rb +0 -0
- data/spec/canvas_sync/processors/assignment_groups_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/assignments_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/content_migrations_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/context_module_items_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/context_modules_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/course_completion_report_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/rubric_assessments_spec.rb +0 -0
- data/spec/canvas_sync/processors/rubric_associations_spec.rb +0 -0
- data/spec/canvas_sync/processors/rubrics_processor_spec.rb +0 -0
- data/spec/canvas_sync/processors/submissions_processor_spec.rb +0 -0
- data/spec/canvas_sync/services/module_event_spec.rb +0 -0
- data/spec/canvas_sync/services/module_item_event_spec.rb +0 -0
- data/spec/factories/admin_factory.rb +0 -0
- data/spec/factories/assignment_factory.rb +0 -0
- data/spec/factories/assignment_group_factory.rb +0 -0
- data/spec/factories/context_module_factory.rb +0 -0
- data/spec/factories/context_module_item_factory.rb +0 -0
- data/spec/factories/course_factory.rb +0 -0
- data/spec/factories/enrollment_factory.rb +0 -0
- data/spec/factories/group_factory.rb +0 -0
- data/spec/factories/group_membership_factory.rb +0 -0
- data/spec/factories/role_factory.rb +0 -0
- data/spec/factories/section_factory.rb +0 -0
- data/spec/factories/submission_factory.rb +0 -0
- data/spec/factories/term_factory.rb +0 -0
- data/spec/factories/user_factory.rb +0 -0
- data/spec/support/fixtures/canvas_responses/admins.json +0 -0
- data/spec/support/fixtures/canvas_responses/module.json +0 -0
- data/spec/support/fixtures/canvas_responses/module_item.json +0 -0
- data/spec/support/fixtures/canvas_responses/roles.json +0 -0
- data/spec/support/fixtures/canvas_responses/terms.json +0 -0
- data/spec/support/fixtures/reports/assignment_groups.csv +0 -0
- data/spec/support/fixtures/reports/assignments.csv +0 -0
- data/spec/support/fixtures/reports/content_migrations.csv +0 -0
- data/spec/support/fixtures/reports/context_module_items.csv +0 -0
- data/spec/support/fixtures/reports/context_modules.csv +0 -0
- data/spec/support/fixtures/reports/course_nicknames.csv +0 -0
- data/spec/support/fixtures/reports/course_progresses.csv +0 -0
- data/spec/support/fixtures/reports/course_progresses_conflict.csv +0 -0
- data/spec/support/fixtures/reports/grading_period_groups.csv +0 -0
- data/spec/support/fixtures/reports/grading_periods.csv +0 -0
- data/spec/support/fixtures/reports/group_memberships.csv +0 -0
- data/spec/support/fixtures/reports/groups.csv +0 -0
- data/spec/support/fixtures/reports/learning_outcome_results.csv +0 -0
- data/spec/support/fixtures/reports/learning_outcomes.csv +0 -0
- data/spec/support/fixtures/reports/provisioning_csv +0 -0
- data/spec/support/fixtures/reports/rubric_assessments.csv +0 -0
- data/spec/support/fixtures/reports/rubric_associations.csv +0 -0
- data/spec/support/fixtures/reports/rubrics.csv +0 -0
- data/spec/support/fixtures/reports/sections.csv +0 -0
- data/spec/support/fixtures/reports/submissions.csv +0 -0
- data/spec/support/fixtures/reports/user_observers.csv +0 -0
- data/spec/support/fixtures/reports/users.csv +0 -0
- data/spec/support/fixtures/reports/xlist.csv +0 -0
- metadata +3 -141
- data/spec/internal/app/models/account.rb +0 -35
- data/spec/internal/app/models/admin.rb +0 -35
- data/spec/internal/app/models/assignment.rb +0 -39
- data/spec/internal/app/models/assignment_group.rb +0 -31
- data/spec/internal/app/models/assignment_override.rb +0 -34
- data/spec/internal/app/models/content_migration.rb +0 -18
- data/spec/internal/app/models/context_module.rb +0 -69
- data/spec/internal/app/models/context_module_item.rb +0 -33
- data/spec/internal/app/models/course.rb +0 -57
- data/spec/internal/app/models/course_nickname.rb +0 -20
- data/spec/internal/app/models/course_progress.rb +0 -29
- data/spec/internal/app/models/enrollment.rb +0 -48
- data/spec/internal/app/models/grading_period.rb +0 -17
- data/spec/internal/app/models/grading_period_group.rb +0 -16
- data/spec/internal/app/models/group.rb +0 -28
- data/spec/internal/app/models/group_membership.rb +0 -26
- data/spec/internal/app/models/learning_outcome.rb +0 -30
- data/spec/internal/app/models/learning_outcome_result.rb +0 -54
- data/spec/internal/app/models/pseudonym.rb +0 -19
- data/spec/internal/app/models/role.rb +0 -27
- data/spec/internal/app/models/rubric.rb +0 -36
- data/spec/internal/app/models/rubric_assessment.rb +0 -23
- data/spec/internal/app/models/rubric_association.rb +0 -20
- data/spec/internal/app/models/score.rb +0 -18
- data/spec/internal/app/models/section.rb +0 -36
- data/spec/internal/app/models/submission.rb +0 -32
- data/spec/internal/app/models/term.rb +0 -46
- data/spec/internal/app/models/user.rb +0 -43
- data/spec/internal/app/models/user_observer.rb +0 -22
- data/spec/internal/app/services/live_events/assignment_event.rb +0 -43
- data/spec/internal/app/services/live_events/course_event.rb +0 -28
- data/spec/internal/app/services/live_events/course_section_event.rb +0 -28
- data/spec/internal/app/services/live_events/enrollment_event.rb +0 -30
- data/spec/internal/app/services/live_events/grade_event.rb +0 -36
- data/spec/internal/app/services/live_events/module_event.rb +0 -26
- data/spec/internal/app/services/live_events/module_item_event.rb +0 -25
- data/spec/internal/app/services/live_events/submission_event.rb +0 -28
- data/spec/internal/app/services/live_events/syllabus_event.rb +0 -31
- data/spec/internal/app/services/live_events/user_event.rb +0 -27
- data/spec/internal/db/migrate/20251029222307_create_users.rb +0 -26
- data/spec/internal/db/migrate/20251029222308_create_pseudonyms.rb +0 -24
- data/spec/internal/db/migrate/20251029222309_create_courses.rb +0 -30
- data/spec/internal/db/migrate/20251029222310_create_groups.rb +0 -29
- data/spec/internal/db/migrate/20251029222311_create_group_memberships.rb +0 -24
- data/spec/internal/db/migrate/20251029222312_create_accounts.rb +0 -23
- data/spec/internal/db/migrate/20251029222313_create_terms.rb +0 -24
- data/spec/internal/db/migrate/20251029222314_create_enrollments.rb +0 -31
- data/spec/internal/db/migrate/20251029222315_create_sections.rb +0 -27
- data/spec/internal/db/migrate/20251029222316_create_assignments.rb +0 -37
- data/spec/internal/db/migrate/20251029222317_create_submissions.rb +0 -32
- data/spec/internal/db/migrate/20251029222318_create_roles.rb +0 -24
- data/spec/internal/db/migrate/20251029222319_create_admins.rb +0 -26
- data/spec/internal/db/migrate/20251029222320_create_assignment_groups.rb +0 -28
- data/spec/internal/db/migrate/20251029222321_create_context_modules.rb +0 -28
- data/spec/internal/db/migrate/20251029222322_create_context_module_items.rb +0 -26
- data/spec/internal/db/migrate/20251029222324_create_grading_periods.rb +0 -28
- data/spec/internal/db/migrate/20251029222325_create_grading_period_groups.rb +0 -24
- data/spec/internal/db/migrate/20251029222326_create_content_migrations.rb +0 -30
- data/spec/internal/db/migrate/20251029222327_create_learning_outcomes.rb +0 -36
- data/spec/internal/db/migrate/20251029222328_create_learning_outcome_results.rb +0 -52
- data/spec/internal/db/migrate/20251029222330_create_rubrics.rb +0 -44
- data/spec/internal/db/migrate/20251029222331_create_rubric_associations.rb +0 -42
- data/spec/internal/db/migrate/20251029222332_create_rubric_assessments.rb +0 -37
- data/spec/internal/db/migrate/20251029222334_create_assignment_overrides.rb +0 -25
- data/spec/internal/db/migrate/20251029222335_create_scores.rb +0 -42
- data/spec/internal/db/migrate/20251029223411_create_user_observers.rb +0 -23
- data/spec/internal/db/migrate/20251029224009_create_course_nicknames.rb +0 -23
- data/spec/internal/db/migrate/20251029224010_create_course_progresses.rb +0 -26
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +0 -3
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +0 -4
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class EnrollmentEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
attr_accessor :enrollment
|
|
16
|
-
|
|
17
|
-
def process()
|
|
18
|
-
@enrollment = Enrollment.where(canvas_id: local_canvas_id(payload[:enrollment_id])).first_or_initialize
|
|
19
|
-
enrollment.canvas_course_id = local_canvas_id(payload[:course_id])
|
|
20
|
-
enrollment.sync_from_api
|
|
21
|
-
if enrollment.user.nil?
|
|
22
|
-
u = User.new(canvas_id: enrollment.canvas_user_id)
|
|
23
|
-
u.sync_from_api
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
class EnrollmentCreatedEvent < LiveEvents::EnrollmentEvent; end
|
|
29
|
-
class EnrollmentUpdatedEvent < LiveEvents::EnrollmentEvent; end
|
|
30
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class GradeEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
|
|
16
|
-
def process
|
|
17
|
-
raise "process must be implemented in your subclass"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
def submission
|
|
23
|
-
Submission.find_by(canvas_submission_id: local_canvas_id(payload[:submission_id]))
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def assignment
|
|
27
|
-
Assignment.find_by(canvas_assignment_id: local_canvas_id(payload[:assignment_id]))
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def user
|
|
31
|
-
User.find_by(canvas_user_id: local_canvas_id(payload[:user_id]))
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
class GradeChangedEvent < LiveEvents::GradeEvent; end
|
|
36
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class ModuleEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
|
|
16
|
-
def process
|
|
17
|
-
return unless payload["context_type"] == "Course"
|
|
18
|
-
context_module = ContextModule.find_or_initialize_by(canvas_id: payload["module_id"])
|
|
19
|
-
context_module.sync_from_api
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
class ModuleCreatedEvent < LiveEvents::ModuleEvent; end
|
|
25
|
-
class ModuleUpdatedEvent < LiveEvents::ModuleEvent; end
|
|
26
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class ModuleItemEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
|
|
16
|
-
def process
|
|
17
|
-
context_module_item = ContextModuleItem.find_or_initialize_by(canvas_id: payload["module_item_id"])
|
|
18
|
-
context_module_item.sync_from_api
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class ModuleItemCreatedEvent < LiveEvents::ModuleItemEvent; end
|
|
24
|
-
class ModuleItemUpdatedEvent < LiveEvents::ModuleItemEvent; end
|
|
25
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class SubmissionEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
|
|
16
|
-
def process
|
|
17
|
-
submission = Submission.where(canvas_id: local_canvas_id(payload["submission_id"])).first_or_initialize
|
|
18
|
-
submission.canvas_assignment_id = local_canvas_id(payload["assignment_id"])
|
|
19
|
-
submission.canvas_user_id = local_canvas_id(payload["user_id"])
|
|
20
|
-
submission.canvas_course_id = submission.assignment.context.canvas_id
|
|
21
|
-
submission.sync_from_api
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
class SubmissionCreatedEvent < LiveEvents::SubmissionEvent; end
|
|
27
|
-
class SubmissionUpdatedEvent < LiveEvents::SubmissionEvent; end
|
|
28
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class SyllabusEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
|
|
16
|
-
def process
|
|
17
|
-
# syllabus = Syllabus.where(course_id: attrs[:course_id]).first_or_initialize
|
|
18
|
-
# syllabus.body = attrs[:syllabus_body] # Syllabus Body can get truncated by live events
|
|
19
|
-
# syllabus.save!
|
|
20
|
-
raise "process must be implemented in your subclass"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
def course
|
|
26
|
-
Course.find_by(canvas_course_id: local_canvas_id(payload[:course_id]))
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
class SyllabusUpdatedEvent < LiveEvents::SyllabusEvent; end
|
|
31
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# #
|
|
2
|
-
# AUTO GENERATED LIVE EVENT
|
|
3
|
-
# This was auto generated by the CanvasSync Gem.
|
|
4
|
-
# You can customize it as needed, but make sure you test
|
|
5
|
-
# any changes you make to the auto generated methods.
|
|
6
|
-
#
|
|
7
|
-
# LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html
|
|
8
|
-
# In the general case, LiveEvent message content should not be trusted - it is highly possible that events may
|
|
9
|
-
# arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API.
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
module LiveEvents
|
|
14
|
-
class UserEvent < CanvasSync::LiveEvents::BaseHandler
|
|
15
|
-
def process
|
|
16
|
-
canvas_user_id = local_canvas_id(payload[:user_id])
|
|
17
|
-
user = User.where(canvas_id: canvas_user_id).first_or_initialize
|
|
18
|
-
user.sync_from_api
|
|
19
|
-
rescue Footrest::HttpError::Unauthorized => e
|
|
20
|
-
# This can happen when a new user is created, but hasn't setup a login on Canvas yet.
|
|
21
|
-
Rails.logger.info("Failed to fetch user #{canvas_user_id}: #{e.backtrace}")
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
class UserCreatedEvent < LiveEvents::UserEvent; end
|
|
26
|
-
class UserUpdatedEvent < LiveEvents::UserEvent; end
|
|
27
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
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 CreateUsers < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :users, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :email
|
|
14
|
-
t.string :first_name
|
|
15
|
-
t.string :last_name
|
|
16
|
-
t.string :workflow_state
|
|
17
|
-
t.string :login_id
|
|
18
|
-
t.string :name
|
|
19
|
-
t.string :sortable_name
|
|
20
|
-
|
|
21
|
-
t.timestamps
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
add_index :users, :canvas_id, unique: true
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
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 CreatePseudonyms < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :pseudonyms, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.bigint :canvas_user_id
|
|
14
|
-
t.string :sis_id
|
|
15
|
-
t.string :unique_id
|
|
16
|
-
t.string :workflow_state
|
|
17
|
-
|
|
18
|
-
t.timestamps
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
add_index :pseudonyms, :canvas_id, unique: true
|
|
22
|
-
add_index :pseudonyms, :canvas_user_id
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
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 CreateCourses < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :courses, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :sis_id
|
|
14
|
-
t.string :course_code
|
|
15
|
-
t.string :name
|
|
16
|
-
t.string :workflow_state
|
|
17
|
-
t.integer :canvas_account_id
|
|
18
|
-
t.integer :canvas_term_id
|
|
19
|
-
t.datetime :start_at
|
|
20
|
-
t.datetime :end_at
|
|
21
|
-
t.bigint :grading_standard_id
|
|
22
|
-
# Optional opt-in columns
|
|
23
|
-
# t.string :public_description
|
|
24
|
-
|
|
25
|
-
t.timestamps
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
add_index :courses, :canvas_id, unique: true
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
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 CreateGroups < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :groups, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :sis_id
|
|
14
|
-
t.bigint :canvas_group_category_id
|
|
15
|
-
t.string :group_category_sis_id
|
|
16
|
-
t.bigint :canvas_account_id
|
|
17
|
-
t.bigint :canvas_course_id
|
|
18
|
-
t.string :name
|
|
19
|
-
t.string :workflow_state
|
|
20
|
-
t.bigint :context_id
|
|
21
|
-
t.string :context_type
|
|
22
|
-
t.integer :max_membership
|
|
23
|
-
|
|
24
|
-
t.timestamps
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
add_index :groups, :canvas_id, unique: true
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
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 CreateGroupMemberships < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :group_memberships, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.bigint :canvas_user_id, null: false
|
|
14
|
-
t.bigint :canvas_group_id, null: false
|
|
15
|
-
t.string :group_sis_id
|
|
16
|
-
t.string :user_sis_id
|
|
17
|
-
t.string :workflow_state
|
|
18
|
-
|
|
19
|
-
t.timestamps
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
add_index :group_memberships, :canvas_id, unique: true
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
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 CreateAccounts < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :accounts, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :sis_id
|
|
14
|
-
t.bigint :canvas_parent_account_id
|
|
15
|
-
t.string :sis_parent_account_id
|
|
16
|
-
t.string :name
|
|
17
|
-
t.string :workflow_state
|
|
18
|
-
|
|
19
|
-
t.timestamps
|
|
20
|
-
end
|
|
21
|
-
add_index :accounts, :canvas_id, unique: true
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
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 CreateTerms < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :terms, id: false do |t|
|
|
12
|
-
t.integer :canvas_id, null: false
|
|
13
|
-
t.string :name
|
|
14
|
-
t.datetime :start_at
|
|
15
|
-
t.datetime :end_at
|
|
16
|
-
t.string :workflow_state
|
|
17
|
-
t.integer :grading_period_group_id
|
|
18
|
-
t.string :sis_id
|
|
19
|
-
|
|
20
|
-
t.timestamps
|
|
21
|
-
end
|
|
22
|
-
add_index :terms, :canvas_id, unique: true
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
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 CreateEnrollments < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :enrollments, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.bigint :canvas_course_id
|
|
14
|
-
t.string :course_sis_id
|
|
15
|
-
t.bigint :canvas_user_id
|
|
16
|
-
t.string :user_sis_id
|
|
17
|
-
t.string :role
|
|
18
|
-
t.integer :canvas_role_id
|
|
19
|
-
t.bigint :canvas_section_id
|
|
20
|
-
t.string :workflow_state
|
|
21
|
-
t.string :base_role_type
|
|
22
|
-
t.datetime :completed_at
|
|
23
|
-
|
|
24
|
-
t.timestamps
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
add_index :enrollments, :canvas_id, unique: true
|
|
28
|
-
add_index :enrollments, :canvas_course_id
|
|
29
|
-
add_index :enrollments, :canvas_user_id
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
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 CreateSections < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :sections, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :sis_id
|
|
14
|
-
t.bigint :canvas_course_id
|
|
15
|
-
t.bigint :canvas_nonxlist_course_id
|
|
16
|
-
t.string :name
|
|
17
|
-
t.string :workflow_state
|
|
18
|
-
t.datetime :start_at
|
|
19
|
-
t.datetime :end_at
|
|
20
|
-
|
|
21
|
-
t.timestamps
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
add_index :sections, :canvas_id, unique: true
|
|
25
|
-
add_index :sections, :canvas_course_id
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
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 CreateAssignments < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :assignments, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :title
|
|
14
|
-
t.text :description
|
|
15
|
-
t.datetime :due_at
|
|
16
|
-
t.datetime :unlock_at
|
|
17
|
-
t.datetime :lock_at
|
|
18
|
-
t.float :points_possible
|
|
19
|
-
t.float :min_score
|
|
20
|
-
t.float :max_score
|
|
21
|
-
t.float :mastery_score
|
|
22
|
-
t.string :grading_type
|
|
23
|
-
t.string :submission_types
|
|
24
|
-
t.string :workflow_state
|
|
25
|
-
t.integer :canvas_context_id
|
|
26
|
-
t.string :canvas_context_type
|
|
27
|
-
t.integer :canvas_assignment_group_id
|
|
28
|
-
t.integer :canvas_grading_scheme_id
|
|
29
|
-
t.integer :canvas_grading_standard_id
|
|
30
|
-
|
|
31
|
-
t.timestamps
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
add_index :assignments, :canvas_id, unique: true
|
|
35
|
-
add_index :assignments, [:canvas_context_id, :canvas_context_type]
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
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 CreateSubmissions < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :submissions, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.bigint :canvas_course_id
|
|
14
|
-
t.bigint :canvas_assignment_id
|
|
15
|
-
t.bigint :canvas_user_id
|
|
16
|
-
t.datetime :submitted_at
|
|
17
|
-
t.datetime :due_at
|
|
18
|
-
t.datetime :graded_at
|
|
19
|
-
t.float :score
|
|
20
|
-
t.float :points_possible
|
|
21
|
-
t.boolean :excused
|
|
22
|
-
t.string :workflow_state
|
|
23
|
-
|
|
24
|
-
t.timestamps
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
add_index :submissions, :canvas_id, unique: true
|
|
28
|
-
add_index :submissions, :canvas_assignment_id
|
|
29
|
-
add_index :submissions, :canvas_course_id
|
|
30
|
-
add_index :submissions, :canvas_user_id
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
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 CreateRoles < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :roles, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :label
|
|
14
|
-
t.string :base_role_type
|
|
15
|
-
t.bigint :canvas_account_id
|
|
16
|
-
t.string :workflow_state
|
|
17
|
-
t.json :permissions
|
|
18
|
-
|
|
19
|
-
t.timestamps
|
|
20
|
-
end
|
|
21
|
-
add_index :roles, :canvas_id, unique: true
|
|
22
|
-
add_index :roles, :canvas_account_id
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
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 CreateAdmins < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :admins, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.string :role_name
|
|
14
|
-
t.bigint :canvas_account_id
|
|
15
|
-
t.bigint :canvas_role_id
|
|
16
|
-
t.bigint :canvas_user_id
|
|
17
|
-
t.string :workflow_state
|
|
18
|
-
|
|
19
|
-
t.timestamps
|
|
20
|
-
end
|
|
21
|
-
add_index :admins, :canvas_id, unique: true
|
|
22
|
-
add_index :admins, :canvas_role_id
|
|
23
|
-
add_index :admins, :canvas_user_id
|
|
24
|
-
add_index :admins, :canvas_account_id
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
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 CreateAssignmentGroups < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :assignment_groups, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id, null: false
|
|
13
|
-
t.bigint :canvas_course_id
|
|
14
|
-
t.string :name
|
|
15
|
-
t.text :rules
|
|
16
|
-
t.integer :position
|
|
17
|
-
t.float :group_weight
|
|
18
|
-
t.string :workflow_state
|
|
19
|
-
t.datetime :canvas_created_at
|
|
20
|
-
t.datetime :canvas_updated_at
|
|
21
|
-
|
|
22
|
-
t.timestamps
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
add_index :assignment_groups, :canvas_id, unique: true
|
|
26
|
-
add_index :assignment_groups, :canvas_course_id
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
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 CreateContextModules < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :context_modules, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id
|
|
13
|
-
t.bigint :canvas_context_id
|
|
14
|
-
t.string :canvas_context_type
|
|
15
|
-
t.integer :position
|
|
16
|
-
t.string :name
|
|
17
|
-
t.string :workflow_state
|
|
18
|
-
t.datetime :deleted_at
|
|
19
|
-
t.datetime :unlock_at
|
|
20
|
-
t.text :completion_requirements
|
|
21
|
-
t.text :prerequisites
|
|
22
|
-
t.timestamps
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
add_index :context_modules, :canvas_id, unique: true
|
|
26
|
-
add_index :context_modules, [:canvas_context_id, :canvas_context_type], name: "index_context_modules_on_context"
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
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 CreateContextModuleItems < ActiveRecord::Migration[5.1]
|
|
10
|
-
def change
|
|
11
|
-
create_table :context_module_items, id: false do |t|
|
|
12
|
-
t.bigint :canvas_id
|
|
13
|
-
t.bigint :canvas_context_module_id
|
|
14
|
-
t.integer :position
|
|
15
|
-
t.bigint :canvas_content_id
|
|
16
|
-
t.string :canvas_content_type
|
|
17
|
-
t.bigint :canvas_assignment_id
|
|
18
|
-
t.string :workflow_state
|
|
19
|
-
|
|
20
|
-
t.timestamps
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
add_index :context_module_items, :canvas_id, unique: true
|
|
24
|
-
add_index :context_module_items, :canvas_context_module_id
|
|
25
|
-
end
|
|
26
|
-
end
|