json_api_model 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/lib/json_api_model/associations/belongs_to.rb +1 -1
- data/lib/json_api_model/scope.rb +10 -6
- data/lib/json_api_model/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: 0dcc8c7cf054ebbc3e13ff7f11e526703d8763fd
|
4
|
+
data.tar.gz: d11d0c76be9f5f0e7ff0b9545731e0534c66485c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d6330ad95f23f9e0e3d97945f00d26f37c0a9d6f79598fba478b901a477718ce1c771121fe96b54c21d7510b8092a98cd0f817bddda3b527bae518449c9c38a
|
7
|
+
data.tar.gz: 55d212fb0693ae234aebc7cfd51c0e7e4f85d7cafd6a860261be22f2c26e8e1ca1f286aa733d03eeaae36c9974de4149c6ffdeae6f82aad55ae40b6ab46f552d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
json_api_model (0.
|
4
|
+
json_api_model (0.4.0)
|
5
5
|
activesupport
|
6
6
|
json_api_client
|
7
7
|
|
@@ -29,15 +29,15 @@ GEM
|
|
29
29
|
i18n (1.1.0)
|
30
30
|
concurrent-ruby (~> 1.0)
|
31
31
|
json (2.1.0)
|
32
|
-
json_api_client (1.
|
32
|
+
json_api_client (1.6.0)
|
33
33
|
activemodel (>= 3.2.0)
|
34
34
|
activesupport (>= 3.2.0)
|
35
35
|
addressable (~> 2.2)
|
36
|
-
faraday (~> 0.
|
36
|
+
faraday (~> 0.15, >= 0.15.2)
|
37
37
|
faraday_middleware (~> 0.9)
|
38
38
|
minitest (5.11.3)
|
39
39
|
multipart-post (2.0.0)
|
40
|
-
public_suffix (3.0.
|
40
|
+
public_suffix (3.0.3)
|
41
41
|
rake (10.5.0)
|
42
42
|
safe_yaml (1.0.4)
|
43
43
|
simplecov (0.16.1)
|
data/lib/json_api_model/scope.rb
CHANGED
@@ -42,21 +42,25 @@ module JsonApiModel
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def params
|
46
|
-
@client_scope.params
|
47
|
-
end
|
48
|
-
|
49
45
|
def method_missing( m, *args, &block )
|
50
46
|
if @client_scope.respond_to? m
|
51
|
-
@client_scope.send m, *args, &block
|
52
|
-
self
|
47
|
+
_new_scope @client_scope.send( m, *args, &block )
|
53
48
|
else
|
54
49
|
all.send m, *args, &block
|
55
50
|
end
|
56
51
|
end
|
57
52
|
|
53
|
+
attr_accessor :client_scope
|
54
|
+
delegate :params, to: :client_scope
|
55
|
+
|
58
56
|
private
|
59
57
|
|
58
|
+
def _new_scope( client_scope )
|
59
|
+
self.class.new( @model_class ).tap do |scope|
|
60
|
+
scope.client_scope = client_scope
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
60
64
|
def cached?
|
61
65
|
@cache.has_key? keyify
|
62
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Orlov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|