462 def const_missing(class_id) 463 if [Object, Kernel].include?(self) || parent == self 464 super 465 else 466 begin 467 begin 468 Dependencies.load_missing_constant self, class_id 469 rescue NameError 470 parent.send :const_missing, class_id 471 end 472 rescue NameError => e 473 # Make sure that the name we are missing is the one that caused the error 474 parent_qualified_name = Dependencies.qualified_name_for parent, class_id 475 raise unless e.missing_name? parent_qualified_name 476 qualified_name = Dependencies.qualified_name_for self, class_id 477 raise NameError.new("uninitialized constant #{qualified_name}").copy_blame!(e) 478 end 479 end 480 end