Skip to content

Commit

Permalink
Controllers which use 'inherit_resources' instead of Inheritance may …
Browse files Browse the repository at this point in the history
…have inherited_resource's methods protected
  • Loading branch information
jbarreneche authored and ryanb committed Sep 16, 2010
1 parent 4eee637 commit 961df90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cancan/inherited_resource.rb
Expand Up @@ -3,16 +3,16 @@ module CanCan
class InheritedResource < ControllerResource # :nodoc:
def load_resource_instance
if parent?
@controller.parent
@controller.send :parent
elsif new_actions.include? @params[:action].to_sym
@controller.build_resource
@controller.send :build_resource
else
@controller.resource
@controller.send :resource
end
end

def resource_base
@controller.end_of_association_chain
@controller.send :end_of_association_chain
end
end
end

0 comments on commit 961df90

Please sign in to comment.