rails_api_documentation 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_api_doc/controller/request/repository.rb +21 -1
- data/lib/rails_api_doc/controller/strong_params/dsl.rb +2 -2
- data/lib/rails_api_doc/controller/strong_params/permitted_params.rb +7 -4
- data/lib/rails_api_doc/params/dsl.rb +2 -2
- data/lib/rails_api_doc/params/finder.rb +1 -1
- data/lib/rails_api_doc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb69d9f7bcbd91be6bb3133dd12aaea9711f40e2
|
4
|
+
data.tar.gz: 809c90106f7e608c76c7654d8ed4833781f706ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406cb23093b4a93239171caaee8d955c4a81dda89f8d2fafc4e7a7e6cb168562b2b7fe1c6b9f2a89be97e18eb4dd37e043c8a8dc971cd443ba7bdd47eb73d558
|
7
|
+
data.tar.gz: fffd6ec4314b1d91b38fbd742bebaabfb0af7da5540675fd3490759f661bad88c9639c093df491d474b54d8197e87c44362ef03695fa5ce63cba95dcaf266115
|
@@ -4,11 +4,31 @@
|
|
4
4
|
class RailsApiDoc::Controller::Request::Repository
|
5
5
|
|
6
6
|
include RailsApiDoc::Controller::Request::Headers
|
7
|
+
|
7
8
|
extend RailsApiDoc::Controller::Repo
|
8
9
|
include RailsApiDoc::Controller::Repo
|
9
10
|
|
11
|
+
class << self
|
12
|
+
|
13
|
+
def params_for_klass(klass)
|
14
|
+
params = {}
|
15
|
+
|
16
|
+
until _abstract_class(klass)
|
17
|
+
params.merge!(self[klass])
|
18
|
+
klass = klass.superclass
|
19
|
+
end
|
20
|
+
|
21
|
+
params
|
22
|
+
end
|
23
|
+
|
24
|
+
def _abstract_class(klass)
|
25
|
+
klass == ActionController::Base || klass == RailsApiDoc::Params
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
10
30
|
def initialize
|
11
|
-
@repo = self.class.repo.clone.transform_values
|
31
|
+
@repo = self.class.repo.clone.transform_values(&:deep_dup)
|
12
32
|
end
|
13
33
|
|
14
34
|
end
|
@@ -7,8 +7,8 @@ module RailsApiDoc
|
|
7
7
|
|
8
8
|
include RailsApiDoc::Controller::ResourceParams::PermittedParams # implements params_to_permit
|
9
9
|
|
10
|
-
def strong_params(pars = params)
|
11
|
-
permitted = params_to_permit(pars)
|
10
|
+
def strong_params(pars = params, params_holder: nil)
|
11
|
+
permitted = params_to_permit(pars, params_holder: params_holder)
|
12
12
|
|
13
13
|
pars.permit(permitted)
|
14
14
|
end
|
@@ -8,14 +8,17 @@ module RailsApiDoc
|
|
8
8
|
#
|
9
9
|
# accepted_params for permit
|
10
10
|
#
|
11
|
-
def params_to_permit(pars = params)
|
12
|
-
|
11
|
+
def params_to_permit(pars = params, params_holder: nil)
|
12
|
+
permitted_params = _permitted_params(params_holder)
|
13
|
+
|
14
|
+
_next_nesting_level(pars, param_data: permitted_params)
|
13
15
|
end
|
14
16
|
|
15
17
|
private
|
16
18
|
|
17
|
-
def _permitted_params
|
18
|
-
::RailsApiDoc::Controller::Request::Repository
|
19
|
+
def _permitted_params(params_holder = nil)
|
20
|
+
::RailsApiDoc::Controller::Request::Repository
|
21
|
+
.params_for_klass(params_holder || self.class)
|
19
22
|
end
|
20
23
|
|
21
24
|
#
|
@@ -19,11 +19,11 @@ module RailsApiDoc::Params::DSL
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def ctrl_strong_params
|
22
|
-
@ctrl_strong_params ||=
|
22
|
+
@ctrl_strong_params ||= strong_params(params_holder: ctrl_parameters)
|
23
23
|
end
|
24
24
|
|
25
25
|
def ctrl_parameters
|
26
|
-
@ctrl_parameters ||= self.class.parameter_class
|
26
|
+
@ctrl_parameters ||= self.class.parameter_class
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_api_documentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|