Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed Class.remove to not blow up on inheritance

git-svn-id: 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit a6a683b0bb7c6019ed38b5d1bba1dac4594dc5da 1 parent 38aae1b
@dhh dhh authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/core_ext/class/removal.rb
6 activesupport/lib/active_support/core_ext/class/removal.rb
@@ -11,12 +11,12 @@ def remove_class(*klasses)
klasses.each do |klass|
# Skip this class if there is nothing bound to this name
next unless defined?(
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 klass = parent.const_get(basename)
+ next unless parent.const_defined?(basename) && klass = parent.const_get(basename)
parent.send :remove_const, basename unless parent == klass
Please sign in to comment.
Something went wrong with that request. Please try again.