2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00
discourse/app/models/concerns/anon_cache_invalidator.rb
Sam c531f4ded5 remove rails-observers
Rails yanked out observers many many years ago, instead the functionality
was yanked out to a gem that is very lightly maintained.

For example: if we want to upgrade to rails 5 there is no published gem

Internally the usage of observers had quite a few problem.

The series of refactors renamed a bunch of classes to give us more clarity
and removed some magic.
2016-12-22 16:46:53 +11:00

13 lines
199 B
Ruby

module AnonCacheInvalidator
extend ActiveSupport::Concern
included do
after_destroy do
Site.clear_anon_cache!
end
after_save do
Site.clear_anon_cache!
end
end
end