apill 2.8.1 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apill/matchers/generic_matcher.rb +1 -1
- data/lib/apill/middleware/api_request.rb +4 -0
- data/lib/apill/mixins/indexable.rb +1 -1
- data/lib/apill/mixins/pageable.rb +1 -1
- data/lib/apill/mixins/queryable.rb +2 -2
- data/lib/apill/mixins/sortable.rb +1 -1
- data/lib/apill/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57ee7efdfee5d8f2b2425c1d8a1683983c0d5c3d
|
4
|
+
data.tar.gz: 3c8ae2f88ec48122895c01a8306cf1b6a22dadb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c094f1dc4250418fcc89b54588e1585dfa66e5165dcee4c16b26444ddcb40315b01baf7874fa5f2957f678ab66dcddd7fa74e2d35d8f036af3e11175f859b7d
|
7
|
+
data.tar.gz: 3a62bad4d957827247fed3eb561eed9c61df95e20b1bd54fe0153d62ea2c76d565b265df982182ee3ee2583129d1786f1de8bea45bab15180fa1de6d75716446
|
@@ -23,6 +23,10 @@ class ApiRequest
|
|
23
23
|
|
24
24
|
env['QUERY_STRING'] = Parameters.process(env['QUERY_STRING'])
|
25
25
|
|
26
|
+
if env['CONTENT_TYPE'] == 'application/vnd.api+json'
|
27
|
+
env['CONTENT_TYPE'] = 'application/json'
|
28
|
+
end
|
29
|
+
|
26
30
|
@app.call(env)
|
27
31
|
else
|
28
32
|
Responses::InvalidApiRequestResponse.call(env)
|
@@ -45,7 +45,7 @@ module Queryable
|
|
45
45
|
resource = if defined? super
|
46
46
|
super
|
47
47
|
else
|
48
|
-
|
48
|
+
__send__(queryed_model_name)
|
49
49
|
end
|
50
50
|
resource = if resource.respond_to? :records
|
51
51
|
resource.records
|
@@ -58,7 +58,7 @@ module Queryable
|
|
58
58
|
resource
|
59
59
|
end
|
60
60
|
|
61
|
-
sanitized_query_params.
|
61
|
+
sanitized_query_params.inject(resource) do |query_resource, query_param|
|
62
62
|
key, value = query_param
|
63
63
|
query_method_name = query_method_name_for(key, resource_class).to_sym
|
64
64
|
|
data/lib/apill/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: human_error
|
@@ -144,4 +144,3 @@ test_files:
|
|
144
144
|
- spec/apill/parameters_spec.rb
|
145
145
|
- spec/apill/requests/rack_request_spec.rb
|
146
146
|
- spec/apill/requests/rails_request_spec.rb
|
147
|
-
has_rdoc:
|