canvas-lms/vendor/plugins
Josh Simpson 91167736a7 fix polymorphic overrides
fixes CNVS-11041
this commit fixes PolymorphicTypeOverride.  PolymorphicTypeOverride was
added as a shim to assist in namespacing models that are referenced in
polymorphic relationships.  It did this by overriding read_attribute on
the particular attribute (e.g., for ContentTag#content_type).
Unfortunately, in some cases, Rails does not use #read_attribute to
access these types (specifically, when calling .preload_associations).
This adds an override for the attr_reader/method associated with the
attribute to be overridden.

Test plan
- Test affected models with old and new data with sharding enabled.

In a sharded environment:
- Attach an old quiz (one created prior to January) to a module
- when navigating to the module, the attached content items should
  display correctly.

Change-Id: Ibfbff5a0d5dc63f6cc3714b22fc3bf4dc04e66cb
Reviewed-on: https://gerrit.instructure.com/29858
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-10 22:31:33 +00:00
..
academic_benchmark don't save a ContentMigration for AcademicBenchmark before all the fields have been set 2013-11-20 21:39:18 +00:00
account_reports fix mysql build student report 2014-02-04 21:25:29 +00:00
acts_as_list don't fail module api PUT when position doesn't change 2014-02-06 23:30:45 +00:00
attachment_fu fix attachment_fu callbacks for rails 3 2014-01-14 13:12:33 +00:00
attachment_fu_regenerate_thumbnails only remove the tempfile we intended to, not everyone's 2013-03-14 15:52:55 -06:00
broadcast_policy optimize random group assignment 2013-12-13 22:30:48 +00:00
delayed_job pend fragile mysql specs 2014-02-10 15:53:52 +00:00
moodle2cc pin all the gems 2014-02-07 16:44:22 +00:00
qti_exporter convert sanitize field plugin into proper gem: CanvasSanitize 2014-01-28 22:36:18 +00:00
rails_xss use action view erubis for rails 3 2014-02-07 17:26:33 +00:00
registration_captcha change block helpers for rails 3.2 compatibility 2013-10-11 23:09:37 +00:00
respondus_soap_endpoint pin all the gems 2014-02-07 16:44:22 +00:00
simply_versioned fix polymorphic overrides 2014-02-10 22:31:33 +00:00
wiziq spec: replace it_should_behave_like with include_examples 2014-01-24 16:02:26 +00:00