canvas-lms/app/models
Cameron Matheson d315baa896 keep root_account_id in sync between course/enrollments
fixes #6142

test plan: Create a course and enroll some students.  Move the course to
  another root account.  The following SQL query should return 0:

    SELECT COUNT(e.id) FROM enrollments e
    INNER JOIN courses c ON e.course_id = c.id
    WHERE e.root_account_id != c.root_account_id

  To test the migration, mess up some of the enrollment
  root_account_ids:

    UPDATE enrollments SET root_account_id = 99

  Before migrating, the SELECT COUNT snippet above should return
  false, after migrating, it should return true.

Change-Id: I9b18dded8a763a8a05f5e631907f77b4e9a1bd49
Reviewed-on: https://gerrit.instructure.com/7081
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-11-28 14:29:58 -07:00
..
abstract_course.rb make course terms sticky 2011-09-30 11:00:27 -06:00
access_token.rb implement oauth2 native app flow, closes #5029 2011-07-18 22:27:36 -06:00
account.rb don't allow setting sis id on root accounts 2011-11-28 13:54:14 -07:00
account_authorization_config.rb add support for SAML encrypted assertions; fixes #5299 2011-11-08 15:54:22 -07:00
account_notification.rb Remove ActiveRecord::Base.find(_all)?_cached 2011-10-05 17:50:47 -06:00
account_report.rb remove mailbox cruft 2011-08-05 12:25:10 -06:00
account_user.rb update_account_associations immediately for new objects 2011-09-14 15:41:55 -06:00
alert.rb alerts, closes #4317 2011-08-24 10:19:44 -06:00
alert_criterion.rb alerts, closes #4317 2011-08-24 10:19:44 -06:00
announcement.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
assessment_question.rb log the id of the assessment question when link translation fails 2011-11-10 11:57:36 -07:00
assessment_question_bank.rb don't repeat questions when picking from banks, fixes #4212 2011-10-19 09:42:29 -06:00
assessment_question_bank_user.rb Initial commit. 2011-01-31 18:57:29 -07:00
assessment_request.rb i18n AssessmentRequest 2011-06-09 16:43:35 -06:00
asset_user_access.rb fix names on the access report, other tweaks; fixes #4682 2011-11-01 11:56:54 -06:00
assignment.rb copy and export/import external tool assignments 2011-11-15 15:33:20 -07:00
assignment_group.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
assignment_reminder.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
attachment.rb include response-content-disposition in S3 download urls 2011-10-26 16:00:31 -06:00
attachment_association.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
authorization_code.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
big_blue_button_conference.rb zero-pad the voiceBridge id 2011-08-10 14:33:34 -06:00
bookmark_service.rb i18n Bookmark Service 2011-06-16 07:16:10 -06:00
calendar_event.rb force dtstart in ics to utc 2011-11-08 10:25:04 -07:00
cloned_item.rb make sure links in assessment questions are correctly translated, fixes #6012 2011-10-21 08:36:34 -06:00
collaboration.rb remove collaborations.yml dependency, refs #5796 2011-10-25 17:32:32 -06:00
collaborator.rb Initial commit. 2011-01-31 18:57:29 -07:00
college.rb Initial commit. 2011-01-31 18:57:29 -07:00
communication_channel.rb redesign merge/registration/confirmation page closes #6149 2011-11-07 12:19:24 -07:00
content_export.rb fix content export error reporting 2011-07-11 13:32:44 -06:00
content_migration.rb don't send email for exported state if configured not to 2011-10-07 14:03:50 -06:00
content_tag.rb UI for creating external tool assignments 2011-11-11 14:54:49 -07:00
context.rb clear out the wiki when resetting course content refs #4583 2011-08-24 12:37:04 -06:00
context_external_tool.rb Basic LTI link selection helper 2011-11-18 11:52:39 -07:00
context_module.rb option to open BLTI links in a new tab 2011-10-07 13:44:52 -06:00
context_module_progression.rb use kept_score for quizzes when evaluating module requirements 2011-08-11 10:01:39 -06:00
context_module_sub_header.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
conversation.rb conversations api, closes #4753 2011-09-13 09:28:57 -06:00
conversation_message.rb return attachment and media comment urls, closes #5850 2011-10-10 12:26:00 -06:00
conversation_message_participant.rb models and controllers for new messaging, refs #3977 2011-05-19 16:21:32 -06:00
conversation_participant.rb conversation loading speedup 2011-10-04 09:54:23 -06:00
course.rb keep root_account_id in sync between course/enrollments 2011-11-28 14:29:58 -07:00
course_account_association.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
course_assigned_group.rb Initial commit. 2011-01-31 18:57:29 -07:00
course_import.rb run course copy asynchronously in a job; fixes #5422 2011-09-08 08:23:47 -06:00
course_section.rb drop SisCrossListedSection 2011-11-28 14:27:10 -07:00
delayed_message.rb fix two common delayed job errors 2011-07-06 12:37:43 -06:00
delayed_notification.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
department.rb Initial commit. 2011-01-31 18:57:29 -07:00
designer_enrollment.rb Initial commit. 2011-01-31 18:57:29 -07:00
developer_key.rb oauth2 web app flow, refs #5029 2011-08-23 17:27:47 -06:00
dim_dim_conference.rb wimba integration, fixes #2989 2011-02-25 14:35:14 -07:00
discussion_entry.rb create submissions when a discussion gains an assignment 2011-11-10 13:06:53 -07:00
discussion_topic.rb create submissions when a discussion gains an assignment 2011-11-10 13:06:53 -07:00
document_service.rb Initial commit. 2011-01-31 18:57:29 -07:00
enrollment.rb fix performance and correctness of triggers, closes #4471, #5168 2011-11-21 09:06:43 -07:00
enrollment_dates_override.rb term start/term end, rather than whenever 2011-09-13 15:20:15 -06:00
enrollment_term.rb optimize UsersController#show a bit 2011-10-06 13:42:42 -06:00
eportfolio.rb account-level option to disable eportfolios, closes #5169 2011-08-24 17:38:06 -06:00
eportfolio_category.rb localize ePortfolios 2011-06-24 13:17:25 -06:00
eportfolio_entry.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
error_report.rb sanitize invalid UTF-8 before creating error reports 2011-09-15 15:30:17 -06:00
etherpad_collaboration.rb remove collaborations.yml dependency, refs #5796 2011-10-25 17:32:32 -06:00
external_feed.rb don't allow single item failures to stop a whole import 2011-06-17 12:21:59 -06:00
external_feed_entry.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
external_url.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
favorite.rb added favorite courses option to main menu 2011-10-24 15:50:34 -06:00
folder.rb redirect to new files with the same path as deleted files 2011-08-10 20:58:30 -06:00
google_docs_collaboration.rb Initial commit. 2011-01-31 18:57:29 -07:00
gradebook_upload.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
grading_standard.rb support fractional values in grading schemes, closes #5397 2011-08-29 12:04:28 -06:00
group.rb disable 'randomly assign students' for restricted self-signup groups 2011-11-04 12:25:44 -06:00
group_category.rb self signup group categories 2011-10-11 17:22:46 -06:00
group_membership.rb include account groups in menu regardless of enrollments 2011-10-20 15:04:52 -06:00
hashtag.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
inbox_item.rb added states so we can retire messages w/o deleting them yet 2011-08-16 21:15:26 -06:00
learning_outcome.rb AR select and order options do not take an array 2011-09-27 12:05:51 -06:00
learning_outcome_group.rb replace ActiveRecord::Base calls with subclass calls where it makes sense 2011-07-18 13:56:08 -06:00
learning_outcome_result.rb avoid several extra cases of saving learning outcome results 2011-05-31 13:10:33 -06:00
mailer.rb allow for configuration of outgoing email name 2011-07-21 13:33:16 -06:00
media_object.rb don't require a session to download attachments through the api 2011-10-07 17:04:43 -06:00
message.rb fix wrong hostname in message emails 2011-08-24 15:30:37 -06:00
notification.rb remove the new wiki page notification 2011-11-08 12:46:05 -07:00
notification_policy.rb fix saving notification preferences with score notifications disabled 2011-11-18 08:56:59 -07:00
oauth_request.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
observer_enrollment.rb Initial commit. 2011-01-31 18:57:29 -07:00
open_object.rb Initial commit. 2011-01-31 18:57:29 -07:00
page_comment.rb localize PageComments 2011-06-17 08:28:33 -06:00
page_view.rb record real_user in page_view fixes #5013 2011-07-08 11:54:48 -06:00
page_view_range.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
plugin_setting.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
pseudonym.rb don't special case the default account to be "Instructure" 2011-11-28 12:50:46 -07:00
pseudonym_session.rb make "stay logged in" use a one-time token 2011-11-22 10:15:13 -07:00
quiz.rb cleanup links in quiz questions; fixes #6212 2011-11-22 16:23:44 -07:00
quiz_group.rb get quiz group name when importing 2011-10-26 12:31:13 -06:00
quiz_question.rb cleanup links in quiz questions; fixes #6212 2011-11-22 16:23:44 -07:00
quiz_submission.rb don't html escape user answers in fimb questions; fixes #5628 2011-11-04 16:15:42 -06:00
quiz_submission_snapshot.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
report_snapshot.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
role_override.rb fixes #6079 changes account admin role default permissions 2011-10-27 10:37:05 -06:00
rubric.rb explicit utc db times in update_all 2011-08-30 16:46:25 -06:00
rubric_assessment.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
rubric_association.rb give option to adjust assignment points possible based on rubric points possible 2011-11-10 13:15:36 -07:00
scribd_account.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
scribd_mime_type.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
session_persistence_token.rb make "stay logged in" use a one-time token 2011-11-22 10:15:13 -07:00
setting.rb conversations api, closes #4753 2011-09-13 09:28:57 -06:00
short_message.rb Initial commit. 2011-01-31 18:57:29 -07:00
short_message_association.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
sis_batch.rb allow sis imports to make things sticky or clear stickiness altogether 2011-10-13 10:54:58 -06:00
sis_batch_log_entry.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
stream_item.rb don't show discussion responses in stream when not allowed 2011-11-04 12:27:27 -06:00
stream_item_instance.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
student_enrollment.rb Initial commit. 2011-01-31 18:57:29 -07:00
submission.rb adding content tag url validation 2011-11-09 13:38:42 -07:00
submission_comment.rb add "mute" function to assignments. fixes #5101 2011-09-30 17:28:25 -06:00
submission_comment_participant.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
ta_enrollment.rb Initial commit. 2011-01-31 18:57:29 -07:00
tableless.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
teacher_enrollment.rb Initial commit. 2011-01-31 18:57:29 -07:00
thumbnail.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
user.rb create pseudonyms in the target account when merging temporary users 2011-11-28 11:32:32 -07:00
user_account_association.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
user_note.rb User notes from conversation messages; still needs UI 2011-07-31 16:09:03 -06:00
user_profile.rb basic lti navigation links 2011-11-04 17:07:17 -06:00
user_service.rb fix user_service utc bug 2011-10-04 09:54:52 -06:00
web_conference.rb remove deprecated ruby syntax 2011-09-27 10:28:22 -06:00
web_conference_participant.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
wiki.rb string extraction for most i18n oddities 2011-06-30 16:48:12 -06:00
wiki_namespace.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
wiki_page.rb remove the new wiki page notification 2011-11-08 12:46:05 -07:00
wiki_page_comment.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
wimba_conference.rb expose sortable name to user, fixes #5317 2011-10-31 12:22:08 -06:00
zip_file_import.rb zip_file_imports i18n 2011-06-10 08:25:15 -06:00