Sha256: 9ab97db487be646b913e3af947ce397248934d6a8ea9afe4c0468026c7c601c7

Contents?: true

Size: 488 Bytes

Versions: 34

Compression:

Stored size: 488 Bytes

Contents

module ActionView
  module Helpers
    module WorkareaCache
      def cache(*)
        if logged_in? && current_user.admin?
          yield
          nil
        else
          super
        end
      end

      def cache_fragment_name(*)
        result = super

        if request.env['workarea.cache_varies'].present?
          result << request.env['workarea.cache_varies']
        end

        result
      end
    end
  end

  ActionView::Helpers.include(Helpers::WorkareaCache)
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.25 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.24 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.23 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.22 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.21 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.20 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.19 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.18 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.17 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.16 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.15 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.14 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.13 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.12 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb