Permalink
Browse files

pass the controller into a proc/lambda

  • Loading branch information...
1 parent 4ccc258 commit 594aa21e7655e0dce554d7949ce94e0c6cf18a6c @fuelxc fuelxc committed Jan 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cancan/controller_resource.rb
View
2 lib/cancan/controller_resource.rb
@@ -140,7 +140,7 @@ def resource_class
when false then name.to_sym
when nil then namespaced_name.to_s.camelize.constantize
when String then @options[:class].constantize
- when Proc then klass = @options[:class].call; klass.is_a?(String) ? klass.constantize : klass
+ when Proc then klass = @options[:class].call(@controller); klass.is_a?(String) ? klass.constantize : klass
else @options[:class]
end
end

0 comments on commit 594aa21

Please sign in to comment.