Sha256: 95cd88298d649466891c9d50382ad3702c68d4ce5a12f23875d5a2ac8afef114
Contents?: true
Size: 547 Bytes
Versions: 22
Compression:
Stored size: 547 Bytes
Contents
decorate JbuilderTemplate, with: :workarea do def _cache_fragment_for(*) return yield if workarea_admin? super end def _cache_key(*) super.tap do |result| result << workarea_cache_varies if workarea_cache_varies.present? end end private def workarea_admin? @context&.controller&.current_user&.admin? rescue ::RuntimeError false end def workarea_cache_varies workarea_request_env['workarea.cache_varies'] end def workarea_request_env @context.controller.request.env || {} end end
Version data entries
22 entries across 22 versions & 1 rubygems