aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/class/removal.rb10
-rw-r--r--activesupport/lib/active_support/dependencies.rb4
2 files changed, 5 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/removal.rb b/activesupport/lib/active_support/core_ext/class/removal.rb
index 628781669d..b217c1957c 100644
--- a/activesupport/lib/active_support/core_ext/class/removal.rb
+++ b/activesupport/lib/active_support/core_ext/class/removal.rb
@@ -8,17 +8,17 @@ class Class #:nodoc:
end
def remove_class(*klasses)
- klasses.each do |klass|
+ klasses.flatten.each do |klass|
# Skip this class if there is nothing bound to this name
next unless defined?(klass.name)
-
+
basename = klass.to_s.split("::").last
parent = klass.parent
-
+
# Skip this class if it does not match the current one bound to this name
next unless parent.const_defined?(basename) && klass = parent.const_get(basename)
-
+
parent.send :remove_const, basename unless parent == klass
end
end
-end \ No newline at end of file
+end
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 6d5adb6605..b82c7e56f3 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -98,10 +98,6 @@ class Module #:nodoc:
# Use const_missing to autoload associations so we don't have to
# require_association when using single-table inheritance.
def const_missing(class_id)
- if Object.const_defined?(:Controllers) && Object::Controllers.const_available?(class_id)
- return Object::Controllers.const_get(class_id)
- end
-
file_name = class_id.to_s.demodulize.underscore
file_path = as_load_path.empty? ? file_name : "#{as_load_path}/#{file_name}"
begin