azahara_schema 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de52d45e49249449b6a9b9ef878c3ddb2f77d3371d3d3d203db5501ccab9cca6
4
- data.tar.gz: eb05968e0506eadf9cf96396f965e45b9752edba05f78df24b2e803253e9775e
3
+ metadata.gz: 64cfd3b12930f20e315da307b4798cb865f9b7fc7abf5824c2715779877db6d4
4
+ data.tar.gz: 42b5b86d09688bbe7da5b9d3e2804dbc703f15b183e477eb3338c6f765d0b0f3
5
5
  SHA512:
6
- metadata.gz: 6aac5dc3fbec9b3b830b9e9c71e798e0591ee5ed1cbda25951f09c416057785dd2f33a5d75db944cb484dc8280f36982c13603d9cd4315cb5582e8719d934706
7
- data.tar.gz: 98f3dce85c3205df24378c42178d550dd76006109338e251c863ae23606d2e1ac363efd9db1fb72299b91b645c18b90b6ef8af4734a1da7ed781e68106dfc9c7
6
+ metadata.gz: d8185abb81f60a8e0f42bd71c6770c8e34582cd3bc5b76398cf964ff330dcfef185fe21c536b255638124776f1f40a8f94e52cffcbeae14e55bff380c41adea7
7
+ data.tar.gz: 92ab81e54c28428bbc3daa6e137d570151d7ba41388610942fad71319c6eee05dfdd41d86be48161735025f0a00505cbdde65abf3c90fc899d8876c3a8631efd
@@ -63,7 +63,7 @@ module AzaharaSchema
63
63
  end
64
64
 
65
65
  def i18n_list_fallback_keys(value)
66
- prefixes.collect{|pref| i18n_scoped_list_key(value, pref) }
66
+ i18n_list_fallback_prefixes.collect{|pref| i18n_scoped_list_key(value, pref) }
67
67
  end
68
68
  end
69
69
  end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module AzaharaSchema
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.3'
3
3
  end
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.1
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-30 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails