lockstep_rails 0.3.55 → 0.3.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/concepts/lockstep/query.rb +16 -2
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f004f3fc636bc3aa132570664bd8536bcd2143204f6234e71be19876027cf8a2
|
4
|
+
data.tar.gz: 58753bea6eddae06522c57dc92af31a4a7cd715805142fc78731d8f5ad2f11ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0fce44761660638e91efd5aa5b183e22ff1772bea8d6fa3ba462fce23a4c684b385f72529858cbc5a0a3058b5d30754aa89389e4d394e6496794bc12f13b326
|
7
|
+
data.tar.gz: d67c11238d5936c4e6af3b65e88e226ca11908f03220101e9f442f6cc7ca91f6402dc154adc2bdd0ebec75ae7bafb06640ab51614e5f8700e43f2b87b2706fbc
|
@@ -92,6 +92,12 @@ class Lockstep::Query
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
def with_count(value)
|
96
|
+
with_clone do
|
97
|
+
criteria[:with_count] = value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
95
101
|
# attr: {customer_name: :desc}
|
96
102
|
def order(*attr)
|
97
103
|
with_clone do
|
@@ -242,13 +248,21 @@ class Lockstep::Query
|
|
242
248
|
else
|
243
249
|
results = parsed_response.is_a?(Array) ? parsed_response : parsed_response["records"]
|
244
250
|
return [] if results.blank?
|
245
|
-
|
246
251
|
results = results[0..(criteria[:limit] - 1)] if criteria[:limit]
|
247
|
-
get_relation_objects results.map { |r|
|
252
|
+
records = get_relation_objects results.map { |r|
|
248
253
|
# Convert camelcase to snake-case
|
249
254
|
r = r.transform_keys { |key| key.underscore }
|
250
255
|
@klass.model_name.to_s.constantize.new(r, false)
|
251
256
|
}
|
257
|
+
|
258
|
+
if criteria[:with_count]
|
259
|
+
{
|
260
|
+
records: records,
|
261
|
+
total_count: parsed_response["totalCount"]
|
262
|
+
}
|
263
|
+
else
|
264
|
+
records
|
265
|
+
end
|
252
266
|
end
|
253
267
|
end
|
254
268
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockstep_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vivek AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|