From 0b270f2d0f7073ad571bc86ad227bd6f80c4947f Mon Sep 17 00:00:00 2001 From: Juan Manuel Barreneche Date: Wed, 15 Sep 2010 04:28:18 +0800 Subject: [PATCH] Use cancan_resource_class for before filters instead of hardcoded ControllerResource class --- lib/cancan/controller_resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cancan/controller_resource.rb b/lib/cancan/controller_resource.rb index 49c57fd..7ecb32c 100644 --- a/lib/cancan/controller_resource.rb +++ b/lib/cancan/controller_resource.rb @@ -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