You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will output Couldn't find policy class for nil when unable to safe_constantize the controller. Maybe that is not possible, but I think it would be helpful for the message to read Couldn't find policy class for CourseContent or maybe a different message since it is not able to find a matching class?
I created a PR with failing tests to better demonstrate the issue.
The text was updated successfully, but these errors were encountered:
When a Hash-like object passed as a record, it is recognized as the optional kwarg.
It could lead to unexpected behaviour (#70).
Temporary solution is to remove it (we don't use it); we should migrate to only-kwargs in the future (i.e. record = nil -> record: nil)
When a Hash-like object passed as a record, it is recognized as the optional kwarg.
It could lead to unexpected behaviour (#70).
Temporary solution is to replace it with optional arg; we should migrate to only-kwargs in the future (i.e. record = nil -> record: nil)
Thanks to @louim for providing a reproduction test!
Co-authored-by: Louis-Michel Couture <louim_1@hotmail.com>
Hey!
I came across a potential problem when scoping params with
authorized_scope
, when trying to use a specific policy, for example:Will raise a
ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash
error.Also related, but maybe not a bug, but the default
implicit_authorization_target
injected here:action_policy/lib/action_policy/rails/controller.rb
Lines 54 to 56 in 7280473
will output
Couldn't find policy class for nil
when unable to safe_constantize the controller. Maybe that is not possible, but I think it would be helpful for the message to readCouldn't find policy class for CourseContent
or maybe a different message since it is not able to find a matching class?I created a PR with failing tests to better demonstrate the issue.
The text was updated successfully, but these errors were encountered: