fix: misnamed method in root account id fixups

* Attachments used to be in its own migration, hence the fixup was
named `run`, but then got moved into the main models migration
and needed to be named `populate`

refs INTEROP-6039
flag=none

test plan
* without this change,
`DataFixup::PopulateRootAccountIdOnModels.run`
will fail
* with it, that will succeed

Change-Id: Ief7fd19c39a98d1133c325be44538a88d9152ef4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243936
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
This commit is contained in:
Xander Moffatt 2020-07-30 18:52:38 -06:00
parent cde3ab1a05
commit 0544b68d1f
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ module DataFixup::PopulateRootAccountIdOnAttachments
# Since Attachments needs multiple passes, in order, they all happen here.
# DataFixup::PopulateRootAccountIdOnModels triggers this fixup
# as part of the `populate_overrides` call. Hopefully no comedy ensues.
def self.run(min, max)
def self.populate(min, max)
# First pass: do standard migration
# Not inside of Attachment.find_ids_in_ranges since that is called inside of

View File

@ -20,7 +20,7 @@ require 'spec_helper'
describe DataFixup::PopulateRootAccountIdOnAttachments do
let(:account) { account_model }
describe('.run') do
describe('.populate') do
it 'updates the root_account_id' do
attachment1 = attachment_model(context: account)
attachment1.update_attributes!(root_account_id: nil)
@ -30,7 +30,7 @@ describe DataFixup::PopulateRootAccountIdOnAttachments do
expect(attachment1.reload.root_account_id).to be_nil
expect(attachment2.reload.root_account_id).to be_nil
DataFixup::PopulateRootAccountIdOnAttachments.run(attachment1.id, attachment2.id)
DataFixup::PopulateRootAccountIdOnAttachments.populate(attachment1.id, attachment2.id)
expect(attachment1.reload.root_account_id).to eq account.id
expect(attachment2.reload.root_account_id).to eq account.id