azahara_schema 0.2.1 → 0.2.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64cfd3b12930f20e315da307b4798cb865f9b7fc7abf5824c2715779877db6d4
|
4
|
+
data.tar.gz: 42b5b86d09688bbe7da5b9d3e2804dbc703f15b183e477eb3338c6f765d0b0f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8185abb81f60a8e0f42bd71c6770c8e34582cd3bc5b76398cf964ff330dcfef185fe21c536b255638124776f1f40a8f94e52cffcbeae14e55bff380c41adea7
|
7
|
+
data.tar.gz: 92ab81e54c28428bbc3daa6e137d570151d7ba41388610942fad71319c6eee05dfdd41d86be48161735025f0a00505cbdde65abf3c90fc899d8876c3a8631efd
|
@@ -15,7 +15,7 @@ module AzaharaSchema
|
|
15
15
|
elsif params['_type'] == 'count'
|
16
16
|
json_result = {count: resource_schema.entity_count}
|
17
17
|
else
|
18
|
-
json_result = resource_schema
|
18
|
+
json_result = {entities: resource_schema, count: resource_schema.entity_count}
|
19
19
|
end
|
20
20
|
render json: json_result
|
21
21
|
}
|
@@ -31,6 +31,7 @@ module AzaharaSchema
|
|
31
31
|
|
32
32
|
attr_accessor :model, :enabled_outputs, :association, :parent_schema
|
33
33
|
attr_accessor :search_query
|
34
|
+
attr_accessor :offset, :limit
|
34
35
|
|
35
36
|
def initialize(model, **attributes)
|
36
37
|
@model = model
|
@@ -237,6 +238,8 @@ module AzaharaSchema
|
|
237
238
|
att = attribute(name)
|
238
239
|
scope = att.add_sort(scope, order) if att
|
239
240
|
end
|
241
|
+
scope = scope.offset(offset) if offset
|
242
|
+
scope = scope.limit(limit) if limit
|
240
243
|
scope
|
241
244
|
end
|
242
245
|
|
@@ -293,6 +296,8 @@ module AzaharaSchema
|
|
293
296
|
end
|
294
297
|
end
|
295
298
|
self.search_query = params[:q] if params[:q]
|
299
|
+
self.offset = params[:offset] if params[:offset]
|
300
|
+
self.limit = params[:limit] if params[:limit]
|
296
301
|
end
|
297
302
|
|
298
303
|
def to_param
|
@@ -303,6 +308,8 @@ module AzaharaSchema
|
|
303
308
|
end
|
304
309
|
params[:c] = column_names
|
305
310
|
params[:q] = search_query if params[:q]
|
311
|
+
params[:offset] = offset
|
312
|
+
params[:limit] = limit
|
306
313
|
params
|
307
314
|
end
|
308
315
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azahara_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Ezr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|