lib/active_support/dependencies.rb in activesupport-2.0.1 vs lib/active_support/dependencies.rb in activesupport-2.0.2
- old
+ new
@@ -214,11 +214,11 @@
mod_name = to_constant_name mod
(%w(Object Kernel).include? mod_name) ? name.to_s : "#{mod_name}::#{name}"
end
# Load the constant named +const_name+ which is missing from +from_mod+. If
- # it is not possible to laod the constant into from_mod, try its parent module
+ # it is not possible to load the constant into from_mod, try its parent module
# using const_missing.
def load_missing_constant(from_mod, const_name)
log_call from_mod, const_name
if from_mod == Kernel
if ::Object.const_defined?(const_name)
@@ -234,11 +234,11 @@
from_mod = Object if from_mod.name.blank?
unless qualified_const_defined?(from_mod.name) && from_mod.name.constantize.object_id == from_mod.object_id
raise ArgumentError, "A copy of #{from_mod} has been removed from the module tree but is still active!"
end
-
+
raise ArgumentError, "#{from_mod} is not missing constant #{const_name}!" if from_mod.const_defined?(const_name)
qualified_name = qualified_name_for from_mod, const_name
path_suffix = qualified_name.underscore
name_error = NameError.new("uninitialized constant #{qualified_name}")
@@ -458,24 +458,24 @@
end
end
class Class
- def const_missing(class_id)
+ def const_missing(const_name)
if [Object, Kernel].include?(self) || parent == self
super
else
begin
begin
- Dependencies.load_missing_constant self, class_id
+ Dependencies.load_missing_constant self, const_name
rescue NameError
- parent.send :const_missing, class_id
+ parent.send :const_missing, const_name
end
rescue NameError => e
# Make sure that the name we are missing is the one that caused the error
- parent_qualified_name = Dependencies.qualified_name_for parent, class_id
+ parent_qualified_name = Dependencies.qualified_name_for parent, const_name
raise unless e.missing_name? parent_qualified_name
- qualified_name = Dependencies.qualified_name_for self, class_id
+ qualified_name = Dependencies.qualified_name_for self, const_name
raise NameError.new("uninitialized constant #{qualified_name}").copy_blame!(e)
end
end
end
end