When run_hook is passed an initial_value parameter, it comes through to the destination hook method as an array. This is usually OK because we mostly intend to pass arrays, but it's no good for the define_abilities hook, which needs to work on a CanCan::Ability, not a plain array.
I'm bypassing this in Breeze Commerce by passing the CanCan::Ability a second time as an argument, which works fine but results in the ugly call
... where the first self is converted into an array and ignored, and the second one passes through as a CanCan::Ability which Breeze::Commerce adds to.
When run_hook is passed an initial_value parameter, it comes through to the destination hook method as an array. This is usually OK because we mostly intend to pass arrays, but it's no good for the define_abilities hook, which needs to work on a CanCan::Ability, not a plain array.
I'm bypassing this in Breeze Commerce by passing the CanCan::Ability a second time as an argument, which works fine but results in the ugly call
... where the first
self
is converted into an array and ignored, and the second one passes through as a CanCan::Ability which Breeze::Commerce adds to.