graphiti 1.2.18 → 1.2.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/query.rb +12 -9
- data/lib/graphiti/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd17ed21a3a7d08e6a1cf0ee76827f1d539091f08234adf596fe9287089305c6
|
4
|
+
data.tar.gz: ee470506b0ccb4d5dc6e0a132021eb2f22e8b6de60e12733922a9a1ca51d0617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058c85a01c7eeb6bf9318500d0b77d143d1b259872e5f98b8470dcce8ca5e5a31d3e4213e032e9c512dec4b00522a4c2030e851e2f0e2f41b23e900876b4c575'
|
7
|
+
data.tar.gz: 7680fe2ffca53e9d8c2ab9ac35ca5ad5c2eb1f4ae2417dc8e233f847ca4e36fad5ec383ed6971c0e325f7a4daa6cb6feffaf19971d1fbebd0437d0585ec24e32
|
data/lib/graphiti/query.rb
CHANGED
@@ -44,16 +44,19 @@ module Graphiti
|
|
44
44
|
|
45
45
|
def hash
|
46
46
|
@hash ||= {}.tap do |h|
|
47
|
-
h[:filter] = filters
|
48
|
-
h[:sort] = sorts
|
49
|
-
h[:page] = pagination
|
50
|
-
|
51
|
-
|
52
|
-
h[:extra_fields] = extra_fields
|
47
|
+
h[:filter] = filters
|
48
|
+
h[:sort] = sorts
|
49
|
+
h[:page] = pagination
|
50
|
+
if association?
|
51
|
+
resource_type = @resource.class.type
|
52
|
+
h[:extra_fields] = {resource_type => extra_fields[resource_type]} if extra_fields.key?(resource_type)
|
53
|
+
else
|
54
|
+
h[:fields] = fields
|
55
|
+
h[:extra_fields] = extra_fields
|
53
56
|
end
|
54
|
-
h[:stats] = stats
|
55
|
-
h[:include] = sideload_hash
|
56
|
-
end
|
57
|
+
h[:stats] = stats
|
58
|
+
h[:include] = sideload_hash
|
59
|
+
end.reject { |_, value| value.empty? }
|
57
60
|
end
|
58
61
|
|
59
62
|
def zero_results?
|
data/lib/graphiti/version.rb
CHANGED