Merge branch 'master' into 2.0

This commit is contained in:
Ryan Bates
2011-09-28 13:45:49 -07:00
2 changed files with 15 additions and 3 deletions
+6 -2
View File
@@ -128,11 +128,15 @@ module CanCan
end
def id_param
@params[parent? ? :"#{name}_id" : :id]
if @options[:id_param]
@params[@options[:id_param]]
else
@params[parent? ? :"#{name}_id" : :id]
end
end
def member_action?
new_actions.include?(@params[:action].to_sym) || @options[:singleton] || (@params[:id] && !collection_actions.include?(@params[:action].to_sym))
new_actions.include?(@params[:action].to_sym) || @options[:singleton] || ( (@params[:id] || @params[@options[:id_param]]) && !collection_actions.include?(@params[:action].to_sym))
end
# Returns the class used for this resource. This can be overriden by the :class option.