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 +4 -4
- data/lib/cache_utils/controller.rb +5 -1
- data/lib/cache_utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b04ed62447f21d0293e18929d3fe6608ee94a9af
|
4
|
+
data.tar.gz: 145e74b7c7aa3f02505f8eb32b1cb2dd8707c3af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
33
|
+
serialize_for_cache(object)
|
30
34
|
}, raw: true
|
31
35
|
end
|
32
36
|
|
data/lib/cache_utils/version.rb
CHANGED