cache_utils 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: a748668ea86e250e5cbe25c593f6131aacf06f75
4
- data.tar.gz: 8bc54cc80bcd345f690c884d45930775baf639d4
3
+ metadata.gz: b04ed62447f21d0293e18929d3fe6608ee94a9af
4
+ data.tar.gz: 145e74b7c7aa3f02505f8eb32b1cb2dd8707c3af
5
5
  SHA512:
6
- metadata.gz: 84e017bb9f2f2ffafc004baac55e8efdcb45cce03887a6682fa563c6cee34cbf12300aba02cd462a82c041e22d407e2dcfa2b2f3b1f36c08a12f38bd57e1b34d
7
- data.tar.gz: 7eb218e0a42b34c56ec8601f6f5160ac846380150a100a33dc65be2fe708ac5e4a0944d3ebf97cb4965bf5599e31af97765ec5189cb0a27694be658897f5f600
6
+ metadata.gz: f7c11f6e600a4f53a9b22bb19b097c29e16a6187981a987650754da70a9737dcbc31d551061d63383fe34fb34045b721b5942c48a4c61b2b9e5357376ddde03f
7
+ data.tar.gz: 022f76b97f3941a945523c5fa4e6410b1fa3797468a792c1feb21597178bebe4a02810b54a2e2a22883c0ab06699932508b782081a54b985f1f36f41f566f348
@@ -24,9 +24,13 @@ module CacheUtils
24
24
  end
25
25
  end
26
26
 
27
+ def serialize_for_cache(object, options = {})
28
+ ActiveModelSerializers::SerializableResource.new(object, options).to_json
29
+ end
30
+
27
31
  def render_with_cache(object, condition, name = {}, options = nil)
28
32
  render jsonapi: cache_if(condition, name, options) {
29
- ActiveModelSerializers::SerializableResource.new(object).to_json
33
+ serialize_for_cache(object)
30
34
  }, raw: true
31
35
  end
32
36
 
@@ -1,3 +1,3 @@
1
1
  module CacheUtils
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Finotto