Sha256: 117614b51c6f94106bcc85806cdb308c8d6cf2c6e0c8d634264806c04f217ec0

Contents?: true

Size: 480 Bytes

Versions: 28

Compression:

Stored size: 480 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(*)
        super.tap { |result| result << cache_varies if cache_varies.present? }
      end

      def cache_varies
        request.env['workarea.cache_varies']
      end
    end
  end

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.15 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.14 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.13 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.12 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.11 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.10 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.9 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.8 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb
workarea-core-3.5.7 lib/workarea/ext/freedom_patches/action_view_cache_helper.rb