sinatra-rest-api 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: f5318060016a3ab26172ab885d655e3a25d2b11b
4
- data.tar.gz: '0648b121a0a9ee2cb83b7231569f937e16a0f19f'
3
+ metadata.gz: f221bc7f806a2770f5903144a0e72fbb9f91be3b
4
+ data.tar.gz: e68a253284bf6490d89f9327d345469c25f9beb9
5
5
  SHA512:
6
- metadata.gz: a0909bde8929319bada54ed5a0c3ef42860be4177873cb183a1ed22895c455ade3d5c5ff14ad61bfe65b95be7262fdc229d26e32c1e88eaa3d63f1e1f72b3fe2
7
- data.tar.gz: c3acb32b5312c06dc8ee91a85f9dae4779649fd317b719e88fb249a15be31480ee0ffe7961ce117f4665b0588543aebcae1974947732748d10f4c7c272138cea
6
+ metadata.gz: a74fd00c70ce021325e9997836b7f70a8f9d276bdef3e31da2fa0811b6ffe01ef207070f838c715c4a750ebaab7eec4abf6c455b1fef0950515c361bb0e7a029
7
+ data.tar.gz: c3dc877e255474a1ee504a2d29dfe476c8d0cfcf9aeb60b013a76c0bc408cef2a948fac7a099760bcafcb6fd0a940de6666a81707a77285baeb58767a9d4250f
@@ -47,8 +47,7 @@ module Sinatra
47
47
 
48
48
  def self.list( route_args, params, mapping )
49
49
  # TODO: option to enable X-Total-Count ?
50
- params[:_where] = params[:_where].nil? ? '1=1' : JSON.parse( params[:_where] )
51
- # params[:_where] = '1=1' unless params[:_where].present?
50
+ params[:_where] = params[:_where].nil? ? {} : JSON.parse( params[:_where] )
52
51
  route_args[:response].headers['X-Total-Count'] = mapping[:count].call( params ).to_s
53
52
  result = mapping[:list].call( params, route_args[:fields] )
54
53
  [ 200, result.to_json( include: route_args[:options].include?( :include ) ? route_args[:options][:include] : mapping[:relations].call( nil ) ) ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rest-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.4.0
20
- - - "~>"
21
- - !ruby/object:Gem::Version
22
- version: '2.0'
19
+ version: '1.4'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.4.0
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
26
+ version: '1.4'
33
27
  description: 'Sinatra REST API generator: CRUD actions, nested resources, supports
34
28
  ActiveRecord, Sequel and Mongoid'
35
29
  email: mat@blocknot.es