workarea-core 3.5.14 → 3.5.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32f457800d2f9e59fb315b3bdedde57f90d04ea6befdd4cf04dc5b4c78838eaf
4
- data.tar.gz: 564f64759f19ea4d0db9b1ea4b7a2c12cdebf629ea2f52b5916519a3c958d611
3
+ metadata.gz: c18e8846e0d53604a413bfebe9180793059f63eef7478a6efb5e3c0762e95112
4
+ data.tar.gz: 6bc004faf032a0172b6d6495ef3d666944cef5726f91a9d41fca8fc69ce03af3
5
5
  SHA512:
6
- metadata.gz: 6ae82b803bfe0daffc1e54953aa54f0c3a045cbe83fbb7b2e0c3d68961746950f442f7d87bee7c6b31c4fb697f685b0db3aa5277b0e6b430e6adabfbab4d9837
7
- data.tar.gz: '094e9624ee3213c17dc554e263dc79538c5c09d2db4868d0f1aaa827db8559e60e46728c171364db364d2ff323f6100e0b2edaeea5746a4f59a73cbc51b16832'
6
+ metadata.gz: b367c165ee4ead94e2969e1ced60328c3fe0696bcac53df7a0a67f0eea1faad9e6b82c1eb6a4d1de2530460a7424326357ab6173c70fb7f0362e5c6435bb7f20
7
+ data.tar.gz: c7a378a34ebc05ee82b12bf92c85b89e22ca1035ed01a429986d4f82ad7cc664cc54ba411eef0419c9773848296dab6f5beae749e7206e33c5c88c9e032279ad
@@ -146,6 +146,7 @@ require 'workarea/ext/mongoid/find_ordered'
146
146
  require 'workarea/ext/mongoid/embedded_children'
147
147
  require 'workarea/ext/sprockets/ruby_processor'
148
148
  require 'workarea/ext/jbuilder/jbuilder_append_partials'
149
+ require 'workarea/ext/jbuilder/jbuilder_cache'
149
150
 
150
151
  if Rails.env.development?
151
152
  require 'workarea/ext/freedom_patches/routes_reloader'
@@ -0,0 +1,29 @@
1
+ decorate JbuilderTemplate, with: :workarea do
2
+ def _cache_fragment_for(*)
3
+ return yield if workarea_admin?
4
+
5
+ super
6
+ end
7
+
8
+ def _cache_key(*)
9
+ super.tap do |result|
10
+ result << workarea_cache_varies if workarea_cache_varies.present?
11
+ end
12
+ end
13
+
14
+ private
15
+
16
+ def workarea_admin?
17
+ @context&.controller&.current_user&.admin?
18
+ rescue ::RuntimeError
19
+ false
20
+ end
21
+
22
+ def workarea_cache_varies
23
+ workarea_request_env['workarea.cache_varies']
24
+ end
25
+
26
+ def workarea_request_env
27
+ @context.controller.request.env || {}
28
+ end
29
+ end
@@ -2,7 +2,7 @@ module Workarea
2
2
  module VERSION
3
3
  MAJOR = 3
4
4
  MINOR = 5
5
- PATCH = 14
5
+ PATCH = 15
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
8
8
 
@@ -94,7 +94,7 @@ Gem::Specification.new do |s|
94
94
  s.add_dependency 'chartkick', '~> 3.3.0'
95
95
  s.add_dependency 'browser', '~> 2.6.1'
96
96
  s.add_dependency 'puma', '>= 4.3.1'
97
- s.add_dependency 'rack', '>= 2.0.8'
97
+ s.add_dependency 'rack' , '>= 2.1.4'
98
98
 
99
99
  # HACK for vendoring active_shipping
100
100
  s.add_dependency 'active_utils', '~> 3.3.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.14
4
+ version: 3.5.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-25 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -1142,14 +1142,14 @@ dependencies:
1142
1142
  requirements:
1143
1143
  - - ">="
1144
1144
  - !ruby/object:Gem::Version
1145
- version: 2.0.8
1145
+ version: 2.1.4
1146
1146
  type: :runtime
1147
1147
  prerelease: false
1148
1148
  version_requirements: !ruby/object:Gem::Requirement
1149
1149
  requirements:
1150
1150
  - - ">="
1151
1151
  - !ruby/object:Gem::Version
1152
- version: 2.0.8
1152
+ version: 2.1.4
1153
1153
  - !ruby/object:Gem::Dependency
1154
1154
  name: active_utils
1155
1155
  requirement: !ruby/object:Gem::Requirement
@@ -1946,6 +1946,7 @@ files:
1946
1946
  - lib/workarea/ext/freedom_patches/string.rb
1947
1947
  - lib/workarea/ext/freedom_patches/uri.rb
1948
1948
  - lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
1949
+ - lib/workarea/ext/jbuilder/jbuilder_cache.rb
1949
1950
  - lib/workarea/ext/mongoid/audit_log_entry.decorator
1950
1951
  - lib/workarea/ext/mongoid/each_by.rb
1951
1952
  - lib/workarea/ext/mongoid/embedded_children.rb