Sha256: 888e18d697a5a52355c7534e7b40b7947b4619802d818ba6fdf844e4c665c288

Contents?: true

Size: 598 Bytes

Versions: 8

Compression:

Stored size: 598 Bytes

Contents

class ExpireFragmentCache
  def self.expire_fragment_cache(record, fragments = [])
    if record.is_a?(Manifestation)
      if fragments.empty?
        fragments = %w[manifestation_html show_detail_user_html show_detail_librarian_html pickup_html title_html title_mobile index_sru]
      end
    end

    I18n.available_locales.each do |locale|
      Role.all_cache.each do |role|
        fragments.each do |fragment|
          Rails.cache.delete([":#{record.class.to_s.downcase}" => record.id, :fragment => fragment, :role => role.name, :locale => locale])
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
enju_seed-0.1.1.pre9 lib/enju_seed/expire_fragment_cache.rb
enju_seed-0.1.1.pre8 lib/enju_seed/expire_fragment_cache.rb
enju_seed-0.1.1.pre7 lib/enju_seed/expire_fragment_cache.rb
enju_core-0.2.0.pre2 lib/enju_core/expire_fragment_cache.rb
enju_core-0.1.1.pre6 lib/enju_core/expire_fragment_cache.rb
enju_core-0.1.1.pre5 lib/enju_core/expire_fragment_cache.rb
enju_core-0.2.0.pre1 lib/enju_core/expire_fragment_cache.rb
enju_core-0.1.1.pre4 lib/enju_core/expire_fragment_cache.rb