特定のrefinerycmsエンジンのワニスサーバーへのパージの送信を自動化するgemを構築しようとしています。そのために、スイーパーではなく、after_filters を使用することにしました。
奇妙なのは、after フィルターがたまにしか呼び出されないことです!
私はrefinerycms 0.9.9.15を使用しています。これはコードです:
require 'refinerycms-pages'
module RefinerycmsPagePurging
def self.included(base)
base.class_eval do
after_filter :purge_pages, :only => [:create, :update, :destroy]
after_filter :purge_all, :only => [:update_positions]
protected
def purge_all
Rails.logger.info "*** Purge all"
end
def purge_pages
Rails.logger.info "*** Purge pages"
end
end
end
end
class Railtie < Rails::Railtie
config.after_initialize do
Admin::PagesController.send :include, RefinerycmsPagePurging
end
end
私が間違っていることはありますか?