Use cancan_resource_class for before filters instead of hardcoded ControllerResource class

This commit is contained in:
Juan Manuel Barreneche 2010-09-15 04:28:18 +08:00 committed by Ryan Bates
parent 961df90ecd
commit 0b270f2d0f

View File

@ -6,7 +6,7 @@ module CanCan
options = args.extract_options!
resource_name = args.first
controller_class.before_filter(options.slice(:only, :except)) do |controller|
ControllerResource.new(controller, resource_name, options.except(:only, :except)).send(method)
self.class.cancan_resource_class.new(controller, resource_name, options.except(:only, :except)).send(method)
end
end