You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/lib/trustie/cache/clear_course_event.rb

18 lines
382 B

#coding=utf-8
module Trustie
module Cache
module ClearCourseEvent
def self.included(base)
base.class_eval{
after_create :clear_course_events
}
end
def clear_course_events
Rails.cache.delete("course_events_#{self.act.course_id}".to_sym) if Rails.env.production? && Setting.course_cahce_enabled?
end
end
end
end