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.45 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.44 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.43 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.42 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.41 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.40 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.39 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.38 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.37 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.36 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.35 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.34 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.33 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.32 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.31 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.30 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.29 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.28 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.27 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.4.26 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb