sinatra-rest-api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra-rest-api/actions.rb +1 -2
- metadata +3 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f221bc7f806a2770f5903144a0e72fbb9f91be3b
|
4
|
+
data.tar.gz: e68a253284bf6490d89f9327d345469c25f9beb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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? ?
|
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.
|
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
|
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
|
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
|