Skip to content

Commit

Permalink
This is not an exception, this is expected
Browse files Browse the repository at this point in the history
  • Loading branch information
semaperepelitsa committed Jan 30, 2012
1 parent 7f2ce31 commit a1ac934
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/mongoid/fields/mappings.rb
Expand Up @@ -30,13 +30,12 @@ def for(klass, foreign_key = false)
end
begin
modules = "BSON::|ActiveSupport::"
if match = klass.to_s.match(Regexp.new("^(#{ modules })?(\\w+)$"))
match = klass.to_s.match(Regexp.new("^(#{ modules })?(\\w+)$"))
if match and MODULE.const_defined?(match[2])
MODULE.const_get(match[2])
else
klass
end
rescue NameError
klass
end
end
end
Expand Down

0 comments on commit a1ac934

Please sign in to comment.