lib/checkr/util.rb in checkr-official-1.0.1 vs lib/checkr/util.rb in checkr-official-1.0.2

- old
+ new

@@ -72,20 +72,14 @@ end end end def self.constantize(str, prefix=false) - str = str.to_s - begin - str.split('::').reduce(Module, :const_get) - rescue NameError => e - if prefix - raise e - else - p = "#{self.name}".split("::").first - constantize("#{p}::#{str}", true) - end + p = "#{self.name}".split("::").first + if "#{str}".split("::").first != p + str = "#{p}::#{str}" end + str.split('::').reduce(Module, :const_get) end end end