File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ * Allow permitting numeric params.
2
+
3
+ Previously it was impossible to permit different fields on numeric parameters.
4
+ After this change you can specify different fields for each numbered parameter.
5
+ For example params like,
6
+ ``` ruby
7
+ book: {
8
+ authors_attributes: {
9
+ ' 0' : { name: " William Shakespeare" , age_of_death: " 52" },
10
+ ' 1' : { name: " Unattributed Assistant" },
11
+ ' 2' : " Not a hash" ,
12
+ ' new_record' : { name: " Some name" }
13
+ }
14
+ }
15
+ ```
16
+
17
+ Before you could permit name on each author with,
18
+ ` permit book: { authors_attributes: [ :name ] }`
19
+
20
+ After this change you can permit different keys on each numbered element,
21
+ ` permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
22
+
23
+ Fixes # 41625
24
+
25
+ * Adam Hess *
26
+
1
27
* Update ` HostAuthorization` middleware to render debug info only
2
28
when ` config.consider_all_requests_local` is set to true .
3
29
You can’t perform that action at this time.
0 commit comments