1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00
varvet--pundit/lib
Andrey Novikov 12602720a5
Add autodetection and override of param key for permitted_attributes helper.
First, trying to get param key for ActiveModel objects, as Rails' `form_for` helper uses it to generate key for parameters hash. See 9f44aa0863/actionview/lib/action_view/helpers/form_helper.rb (L433) for reference.

Second, allowing to redefine it with `param_key` option (as element in optional second argument hash), it is useful in case of single table inheritance, when the param key is differs from actual class (as it is getting defined at runtime).

And last, use previous behaviour otherwise.

Fixes https://github.com/elabs/pundit/issues/286
2015-07-13 16:56:55 +03:00
..
generators Reorder policy spec actions 2014-10-31 14:25:56 -04:00
pundit tagged 1.0.1 2015-05-27 18:31:53 +02:00
pundit.rb Add autodetection and override of param key for permitted_attributes helper. 2015-07-13 16:56:55 +03:00