1
0
Fork 0
forked from OpenNeo/impress
impress/app/models/fragment_expiration.rb

26 lines
588 B
Ruby
Raw Normal View History

module FragmentExpiration
include FragmentLocalization
delegate :expire_fragment, :to => :controller
def expire_fragment_in_all_locales(key)
I18n.available_locales.each do |locale|
localized_key = localize_fragment_key(key, locale)
expire_fragment(localized_key)
end
end
2013-06-27 00:00:37 -07:00
def expire_key_in_all_locales(key)
I18n.available_locales.each do |locale|
localized_key = localize_fragment_key(key, locale)
Rails.cache.delete(localized_key)
end
end
private
def controller
@controller ||= ActionController::Base.new
end
end