Commit Graph

3 Commits

Author SHA1 Message Date
Cody Cutrer 51fb498800 fix callback suspension for ruby 2
need to check for private methods

Change-Id: I5b51b3da9ab3baa8b619c10b684d96fe685a0c9d
Reviewed-on: https://gerrit.instructure.com/36749
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-23 22:01:05 +00:00
Jacob Fugal f2e7523419 fix activesupport-suspend_callbacks for 4.1
activesupport 4.1 doesn't have CallbackChain inherit from Array anymore,
instead, it houses an internal array and delegates to it.

Change-Id: I5730f734be5e7c0422ac56245609043f52b6425a
test-plan: specs
Reviewed-on: https://gerrit.instructure.com/33081
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-04-16 15:12:22 +00:00
Jacob Fugal d023b40217 ActiveSupport::Callbacks::Suspension
refs CNVS-9522

replace our hokey ActiveRecord::Base.suspend_callbacks implementation
with something that integrates nicely with ActiveSupport::Callbacks in
general, as a gem.

include it into ActiveRecord::Base and use it to implement
save_without_callbacks for rails3 (rails2 still needs to do it the way
we had it before, because the notifications callback isn't handled
through ActiveSupport::Callbacks).

test-plan:
 - make sure ActiveRecord callbacks still run in most cases (e.g. after
   creating a course through the UI, it should have a value in the uuid
   column in the database)
 - make sure callbacks don't run while suspended (e.g. have a user
   enrolled in two courses. call user.delete_enrollments. both
   enrollments should be deleted, but only one delayed job for due date
   caching should be created)

Change-Id: Iecd1cc0346e218261677d16ee44bae9cb9149ddd
Reviewed-on: https://gerrit.instructure.com/29809
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-02-19 20:20:00 +00:00