jsonapi_compliable 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ac1ea02274ee52a60910c86b28d7acde7849763
|
|
4
|
+
data.tar.gz: c9355a34cc97a996f5f4ebb3c1006ce01eb092db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13eee8dc46e114513fcfabff4004ad16a96cad84e093f2c085ef6d1c71b63fc2615f124f76ba25825f454985ae6da2c17b25e101491ebec9deff7b42de16e930
|
|
7
|
+
data.tar.gz: 6eeadb16744a3564c68f78a420bf9f3267e2cc308e470e29763de1b4936ead081c34dfbac45743f7b2022efed20b0267519d331a68ebc4e4dd4f344ba9b3d09f
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module JsonapiCompliable
|
|
2
2
|
module Adapters
|
|
3
3
|
module ActiveRecordSideloading
|
|
4
|
-
def has_many(association_name, scope
|
|
4
|
+
def has_many(association_name, scope: nil, resource:, foreign_key:, primary_key: :id, &blk)
|
|
5
5
|
_scope = scope
|
|
6
6
|
|
|
7
7
|
allow_sideload association_name, resource: resource do
|
|
@@ -24,7 +24,7 @@ module JsonapiCompliable
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def belongs_to(association_name, scope
|
|
27
|
+
def belongs_to(association_name, scope: nil, resource:, foreign_key:, primary_key: :id, &blk)
|
|
28
28
|
_scope = scope
|
|
29
29
|
|
|
30
30
|
allow_sideload association_name, resource: resource do
|
|
@@ -44,7 +44,7 @@ module JsonapiCompliable
|
|
|
44
44
|
instance_eval(&blk) if blk
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
def has_one(association_name, scope
|
|
47
|
+
def has_one(association_name, scope: nil, resource:, foreign_key:, primary_key: :id, &blk)
|
|
48
48
|
_scope = scope
|
|
49
49
|
|
|
50
50
|
allow_sideload association_name, resource: resource do
|
|
@@ -66,7 +66,7 @@ module JsonapiCompliable
|
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
def has_and_belongs_to_many(association_name, scope
|
|
69
|
+
def has_and_belongs_to_many(association_name, scope: nil, resource:, foreign_key:, primary_key: :id, as: nil, &blk)
|
|
70
70
|
through = foreign_key.keys.first
|
|
71
71
|
fk = foreign_key.values.first
|
|
72
72
|
_scope = scope
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jsonapi_compliable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lee Richmond
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-
|
|
12
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: jsonapi-serializable
|