Closed badlamer closed 8 years ago
hi @badlamer. Thanks for the PR! Does it crash for you when including in Grape projects without this change?
That module is only included in Rails projects like this:
https://github.com/chaps-io/access-granted/blob/master/lib/access-granted.rb#L11-L21
So it shouldn't be executed in non-Rails projects.
This works with Grape and ApplicationCable::Channel.
Without changes grape NoMethodError (undefined method `helper_method' for #
class API < Grape::API
helpers AccessGranted::Rails::ControllerMethods
end
Cool, let's merge it then! Time for me to add those hooks to support Grape out of the box :)
I just released 1.0.2
version with your fix, thanks for the report and keep the bug fixes coming!
Similar to https://github.com/CanCanCommunity/cancancan/blob/develop/lib/cancan/controller_additions.rb#L297