test plan:
- in console, create blackout_dates on Course and Account contexts
and ensure associations work
- ensure start and end dates and the event title are required
by validation
- ensure the end date cannot come before the start date
closes LS-2426
flag = none
Change-Id: I480642350c574aead0e66a6fe0fdd7bbb31fdcbf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272437
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
This is part 3.1 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.
Stops writing into lookup_id and resource_link_id columns.
refs INTEROP-6488
flag=none
test-plan:
* specs should pass;
* you should check if LTI is launching as expected, and if the custom
params was expanded as expected in all records that were created in
the part 1, 2 and 3;
* you should be able to new persist custom params, for example you can
use the RCE editor placement;
* you can follow the test-plan:
* https://gerrit.instructure.com/c/canvas-lms/+/256029
* https://gerrit.instructure.com/c/canvas-lms/+/254453
Change-Id: I9b2c85e0afb333c17afb1be0fb4a543f145ba400
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258317
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
This is part 1 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links. We're adding the
new columns lookup_uuid and resource_link_uuid.
refs INTEROP-6488
flag=none
test-plan:
* specs should pass;
* you should check if LTI is launching as expected;
* you should check that the tool is saving the resouce link properly,
and lookup_uuid should be the same value of lookup_id,
and resource_link_uuid should be the same value of resource_link_id;
* you can follow the test-plan:
* https://gerrit.instructure.com/c/canvas-lms/+/256029
* https://gerrit.instructure.com/c/canvas-lms/+/254453
Change-Id: Ie19b64e48cb407e53459c26d901f9e922e548d65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257852
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Having a delayed job with an id of 1 causes a conflict later when
inst-jobs automatically creates a job also with an id of 1. As a
workaround, manually create one with an id of 2.
fixes INTEROP-6439
Change-Id: I3a8842bf0073972293cc83c3bfd263ab1fa57053
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256383
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
The web_conference table has a root_account_id on it in prod now.
Change-Id: Ieea0b1873f0ed36a08886918837c732af2d6a4c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256117
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
When creating an AssignmentOverride for the CDC schema tests,
it currently fills in 1 for assignment_id.
Any required integer field is auto-filled with a 1, so we're
assuming that an assignment exists with an ID of 1. This isn't
a safe assumption, so look for an actual assignment instead, and
throw a ForeignKeyNotSatisfied error if there isn't one yet.
(ForeignKeyNotSatisfied will push this model to the back of the queue
and try to create it later, after other models have been created.)
Change-Id: I6dea6e5e6e0c553a3ba261f47565fc1dda95ce7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248890
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
This is in a separate repository (model-generator) now.
Change-Id: I5974799efe41d44b624dc037991d684e1c64a26e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237022
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Slade <jslade@instructure.com>
Reviewed-by: Jeremy Slade <jslade@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Plugin.enabled? will return false if the PluginSetting has an
empty settings hash, even if PluginSetting.disabled is false.
A conference-type plugin needs to be enabled before a WebConference
can be created. And a WebConference needs to be created to test
the web_conferences table in the CDC build.
test plan:
- RAILS_ENV=test bundle exec rake db:test:fill_tables does not error
refs PLAT-5394
Change-Id: Ia4d1b762a3f1427e3c2378cadd4d4d1a9d0899cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229736
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
WebConference has a self.conference_type= method, giving it
some custom logic when setting a conference_type value that
can't be skipped by ignoring validations and callbacks.
refs PLAT-5361
Change-Id: Ie6b645f9a4f8afb24b199dd79d0c332f5297227d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228702
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Instead of just "default," a string of a's will be used.
It'll be either 8 characters or the column limit, whichever
is fewer.
PLAT-5361
Change-Id: I30ee99e50dd334aa750c917ed7f76bd68add1b64
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228701
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
Change the find_partman_columns method to only return the
relation name (foo) rather than the column name (foo_id), since
we want to fill in both foo_id and foo_type now.
The polymorphic_class_name method looks at the polymorphic
assiciations on the model to find a valid class name to fill in
for foo_type.
refs PLAT-5361
Change-Id: I1ca21fe19228bcf2584aa55ed2979d782cf055e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228700
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
If a model has a 'type' attribute, ActiveRecord expects
that value to be the name of a class that extends the
model. It can be safely auto-filled with the name of
any class that extends the given model.
refs PLAT-5361
Change-Id: I2251db6647551131bdacdea90b596de14b80c59d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228699
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
This is more reliable than what was being done before.
We have a Tableless model that is extended by some of
our other models; Tableless overrides the `columns`
method to return a value even though it doesn't have a table.
refs PLAT-5361
Change-Id: Ib0c2e6c9af6dd194246ef8f9f9711fc3e2b9082a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228697
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
This will generate models that are "valid enough" to be inserted
into the database. The aren't entirely valid models -- it skips
any ActiveRecord validations before saving. But they do satisfy
the column types and constraints that Postgres has, which is enough
to trigger CDC events.
test plan:
- Have an empty test database (RAILS_ENV=test rake db:reset)
- Run RAILS_ENV=test rake db:test:fill_tables
- There should be at least one row in each table in your test database
flag = none
refs PLAT-5361
Change-Id: I6a2761a2f44f2b4fe69182b971c5a5d5b5139512
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227959
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>