Skip to content

Commit

Permalink
klass.to_s.constantize equals klass
Browse files Browse the repository at this point in the history
  • Loading branch information
semaperepelitsa committed Jan 30, 2012
1 parent d5d329f commit 6d35e4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid/fields/mappings.rb
Expand Up @@ -33,7 +33,7 @@ def for(klass, foreign_key = false)
if match = klass.to_s.match(Regexp.new("^(#{ modules })?(\\w+)$"))
"#{MODULE}::#{ match[2] }".constantize
else
klass.to_s.constantize
klass
end
rescue NameError
klass
Expand Down

0 comments on commit 6d35e4d

Please sign in to comment.