introspective_grape 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/introspective_grape/api.rb +10 -5
- data/lib/introspective_grape/version.rb +1 -1
- data/spec/rails_helper.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c030a296ffbf221b0efa559f3e7e6ab2d30afae4
|
4
|
+
data.tar.gz: 9eb9b3edc3fa75e0204de34d1b704700ed08f621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1423ab9e477c4f022d0ddcb424ffccca23a778d393eb43cbaa060b86a5e11d366130227230686aedb4258a139d68577adfbde889531d4a6606e0d0938a477c8b
|
7
|
+
data.tar.gz: c683edd9b8fc4733e0cc05901e77775c4ef9a40997c44d8a81a7e5d357918decd12f0142e30fd9ec770a768db950e1928d4fcc263490a77527cb64bea4402994
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
|
+
0.2.3 10/21/2016
|
3
|
+
==============
|
4
|
+
### Bug Fix
|
5
|
+
|
6
|
+
We have to modify request.params and then re-assign @params to request.params before
|
7
|
+
validation in order to work with Grape's habit of mucking with both independently.
|
8
|
+
|
9
|
+
This makes Grape validations work properly again against camel inputs.
|
10
|
+
|
2
11
|
0.2.2 10/20/2016
|
3
12
|
==============
|
4
13
|
|
@@ -52,11 +52,16 @@ module IntrospectiveGrape
|
|
52
52
|
self.send(IntrospectiveGrape::API.authentication_method(self))
|
53
53
|
end
|
54
54
|
|
55
|
-
child.
|
56
|
-
#
|
57
|
-
#
|
58
|
-
|
59
|
-
|
55
|
+
child.before_validation do
|
56
|
+
# We have to snake case the Rack params then re-assign @params to the
|
57
|
+
# request.params, because of the I-think-very-goofy-and-inexplicable
|
58
|
+
# way Grape interacts with both independently of each other
|
59
|
+
(params.try(:with_snake_keys)||{}).each do |k,v|
|
60
|
+
request.delete_param(k.camelize(:lower))
|
61
|
+
request.update_param(k, v)
|
62
|
+
end
|
63
|
+
@params = request.params
|
64
|
+
end if IntrospectiveGrape.config.camelize_parameters
|
60
65
|
end
|
61
66
|
|
62
67
|
# We will probably need before and after hooks eventually, but haven't yet...
|
data/spec/rails_helper.rb
CHANGED
@@ -3,6 +3,7 @@ Coveralls.wear!('rails')
|
|
3
3
|
ENV["RAILS_ENV"] = 'test'
|
4
4
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
5
5
|
require 'rspec/rails'
|
6
|
+
#require 'byebug'
|
6
7
|
require 'support/request_helpers'
|
7
8
|
require 'support/pundit_helpers'
|
8
9
|
Dir[Rails.root.join("../support/**/*.rb")].each { |f| require f }
|