lib/activefacts/api/vocabulary.rb in activefacts-api-1.9.4 vs lib/activefacts/api/vocabulary.rb in activefacts-api-1.9.5

- old
+ new

@@ -30,18 +30,11 @@ camel = name.to_s.camelcase if (c = @object_type[camel]) __bind(camel) c else - if const_defined?(camel) - begin - const_get(camel) - rescue NameError - nil - end - else - nil - end + klass = const_get(camel) rescue nil # NameError if undefined + klass && klass.modspace == self ? klass : nil end end # Create a new constellation over this vocabulary def constellation