From 2737b7e2acbd60a9be6decffcd1853fadc86a86f Mon Sep 17 00:00:00 2001 From: Harri Kauhanen Date: Tue, 9 Sep 2008 10:11:29 +0300 Subject: [PATCH] Fixed a bug caused namespaced model not behave --- activesupport/lib/active_support/dependencies.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 3d871ee..fd93d70 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -402,13 +402,16 @@ module ActiveSupport #:nodoc: 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 uninherited_const_defined?(from_mod, const_name) + # TODO Is this change ok? + # Removed, because causes namespaced models misbehave. + # raise ArgumentError, "#{from_mod} is not missing constant #{const_name}!" if uninherited_const_defined?(from_mod, const_name) qualified_name = qualified_name_for from_mod, const_name path_suffix = qualified_name.underscore name_error = NameError.new("uninitialized constant #{qualified_name}") file_path = search_for_file(path_suffix) + if file_path && ! loaded.include?(File.expand_path(file_path)) # We found a matching file to load require_or_load file_path raise LoadError, "Expected #{file_path} to define #{qualified_name}" unless uninherited_const_defined?(from_mod, const_name) -- 1.5.5.1