deep_unrest 0.1.54 → 0.1.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deep_unrest/read.rb +16 -14
- data/lib/deep_unrest/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: e9439a12cece497a2f6c344216e2f71c443dcfe6e9bc8b29b2a0a6bd88aa280e
|
4
|
+
data.tar.gz: 13886a9c1f9dcb8384e0c80f1ebf14073bd16403ac6098ab5f463346af8c58b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad6eb16bc28178c2bcb04b5ea88bb63e9dee5326c9da52f52e5c1ea2b2df045255cf52810d36f409cab0f9832b8f7aaa1ab2165a47a2e641344508aef897b2a
|
7
|
+
data.tar.gz: 165b21701d238820f826283708940f60bdbb9a10376b8980742565a8cb2e706879e2947380733f22a3b0ed8b0a999d5a76aa536397f27707b92c7cf14a51233c
|
data/lib/deep_unrest/read.rb
CHANGED
@@ -120,20 +120,22 @@ module DeepUnrest
|
|
120
120
|
item[:scope].merge(records_original(ctx))
|
121
121
|
}
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
123
|
+
begin
|
124
|
+
# transform sort value casing for rails
|
125
|
+
sort_criteria = query[:sort]&.map { |s| s.clone.merge(field: s[:field].underscore) }
|
126
|
+
|
127
|
+
processor = JSONAPI::Processor.new(resource,
|
128
|
+
:find,
|
129
|
+
filters: query[:filter] || {},
|
130
|
+
context: { current_user: item[:current_user] },
|
131
|
+
sort_criteria: sort_criteria,
|
132
|
+
paginator: paginator)
|
133
|
+
|
134
|
+
jsonapi_result = processor.process
|
135
|
+
ensure
|
136
|
+
# un-monkey patch the resource :records method
|
137
|
+
r_metaclass.send(:alias_method, :records, :records_original)
|
138
|
+
end
|
137
139
|
|
138
140
|
meta << {
|
139
141
|
addr: [*addr, item[:key], 'meta'],
|
data/lib/deep_unrest/version.rb
CHANGED