grape-listing 1.1.12 → 1.2.1

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: 24a7834408559f2cc73e927ca47c35f730af49d805d8a767d83164e84d146db5
4
- data.tar.gz: 811060c96285d52836599db7dfccf428bb0ccb94d47b46d7bc01ed4c0b6b13a3
3
+ metadata.gz: ba00678e6ce8506dd80ac31e49dda56058cbb7ad385f2264018e18e9d9279632
4
+ data.tar.gz: a622910e11b063da43d43edcde6a76d40e66affeb53b3ce490ef0900d6012c54
5
5
  SHA512:
6
- metadata.gz: 71bb4d98aa0ef81e199a9b4d366d2f77afa9acf3d13f76365a216a82e158a33d98d0ee899ca52c3cccf753196ab05fd4bce288ab9147460476863d58bc7b03e7
7
- data.tar.gz: 6027a2a7b170b43b352df18608556b62ccfd2492775c28d58a84d5fa09b219c28964d41f35e62757120873bb8f21677a5a07640e64875e31f42be3a1d3eee2bf
6
+ metadata.gz: e2acc4de1f0cfd8406ffd4aa237df70b3058fba8a3d30ce0397aa4b617d6280a9a780c91f77c5d0f3e852f41bbf87b0875ef8582796ab1916d4f65eda4134d86
7
+ data.tar.gz: ccb7b6dfe1251b06760f39a7de49da40aed8ab31960d481536ec7b7cd59df32b5d21b173a7bb374a8247295c33a286e31e093090c9e1a8049b81dabfa090b155
@@ -48,7 +48,15 @@ module GrapeListing
48
48
  def caching_entity_representation(record)
49
49
  key = "#{@grape_entity}:#{record.id}"
50
50
 
51
- GrapeListing.cache.fetch(key) do
51
+ # опции кеширования
52
+ opts =
53
+ if @caching.is_a?(ActiveSupport::Duration)
54
+ { expires_in: @caching }
55
+ else
56
+ {}
57
+ end
58
+
59
+ GrapeListing.cache.fetch(key, opts) do
52
60
  @grape_entity.represent(record, @entity_opts).as_json
53
61
  end
54
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-listing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Павел Бабин
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack