Closed capicue closed 10 years ago
I'm happy to merge a refactor, but I don't really understand the use case you describe. Why would you ever pass {:actions => {:actions => :read}}
? It would be very strange to have a controller method called actions
, wouldn't it?
Merged because I think the code looks better with your changes, but I'm going to delete the spec that says "it doesn't throw an error if the actions hash has an :actions key" because I think that's an edge use case and doesn't need to be documented in the tests.
Thanks for the patch! :)
Observed Issue
The
overridden_actions
method gets applied twice to the options parameter ofauthorize_actions_for
. As a result, a type error is thrown if options is of the form{:actions => {:actions => :read}}
.Fix
overridden_actions
method.add_actions
method to add to the current action map.force_action
method to update all actions in the current action map.