Classify causes plural model names to be incorrectly renamed

Some model names will be renamed incorrectly e.g. 'business'. It should
be the responsibility of the user to make sure they use a name that
directly corresponds to the model name. The only filtering performed
should be camelize.
This commit is contained in:
Oliver Morgan
2012-05-31 10:45:55 +01:00
parent 78cbcf1db9
commit 245b83f6b4
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ module CanCan
def resource_class
case @options[:class]
when false then name.to_sym
when nil then (@name || namespaced_name).to_s.classify.constantize
when nil then (@name || namespaced_name).to_s.camelize.constantize
when String then @options[:class].constantize
else @options[:class]
end