json_api_resource_connections 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_api_resource_connections.rb +15 -1
- data/lib/json_api_resource_connections/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5464f3db319f337b50a49b11d643c6b667b25f24
|
4
|
+
data.tar.gz: 849c3f3dc0eebc242e7fa0b24a29bd5ca1b0a1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58861256f912031c5364396f1d7d1d2dbab728c77a095809176683f597706cd1ac4b3a428e3dd02e9a290b50848f8dfc47379cf97d50bf0c7e3a04ac5fd3aa83
|
7
|
+
data.tar.gz: bbc346515f3454d659f8c3edb5e144e73629b2a9e98f614566bc54a4a1c25ca037423698d50d4333252ab315366bbaf869c1e40aa646309013ff0d1ae0da2258
|
@@ -28,9 +28,23 @@ module JsonApiResourceConnections
|
|
28
28
|
class_attribute :_fallbacks
|
29
29
|
self._fallbacks = []
|
30
30
|
|
31
|
+
class_attribute :_cache_first
|
32
|
+
self._cache_first = []
|
33
|
+
|
31
34
|
def cache_fallback(*actions)
|
32
35
|
self._fallbacks = _fallbacks + Array(actions)
|
33
|
-
|
36
|
+
options = { client: self.client_class }
|
37
|
+
options[:only] = self._fallbacks if self._fallbacks.present?
|
38
|
+
|
39
|
+
add_connection JsonApiResource::Connections::CacheConnection, options
|
40
|
+
end
|
41
|
+
|
42
|
+
def try_cache_first(*actions)
|
43
|
+
self._cache_first = _cache_first + Array(actions)
|
44
|
+
options = { client: self.client_class }
|
45
|
+
options[:only] = self._cache_first if self._cache_first.present?
|
46
|
+
|
47
|
+
prepend_connection JsonApiResource::Connections::CacheConnection, options
|
34
48
|
end
|
35
49
|
|
36
50
|
def wraps(client)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_resource_connections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|