Permalink
Browse files

Merge pull request #4784 from semaperepelitsa/constantize

A little constantize update
  • Loading branch information...
2 parents 049dc50 + 46fc0f2 commit 7bfdbeabd26f87d9e6bb6891d6c8dee36d1dfcb1 @tenderlove tenderlove committed Feb 1, 2012
@@ -351,7 +351,7 @@ module ClassMethods
def tests(controller_class)
case controller_class
when String, Symbol
- self.controller_class = "#{controller_class.to_s.underscore}_controller".camelize.constantize
+ self.controller_class = "#{controller_class.to_s.camelize}Controller".constantize
when Class
self.controller_class = controller_class
else
@@ -212,7 +212,7 @@ def constantize(camel_cased_word) #:nodoc:
constant = Object
names.each do |name|
- constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name)
+ constant = constant.const_get(name, false)
end
constant
end

0 comments on commit 7bfdbea

Please sign in to comment.