class String
def safe_constantize
'Class'.safe_constantize # => Class
'Module'.safe_constantize # => Module
or is not initialized. See ActiveSupport::Inflector.safe_constantize
in the string. It returns nil when the name is not in CamelCase
+safe_constantize+ tries to find a declared constant with the name specified
def safe_constantize ActiveSupport::Inflector.safe_constantize(self) end