Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't prepend module twice

  • Loading branch information...
commit eb0b3691d1c4acc3b88e7ba403a4ad5df2ddface 1 parent 5a92f9c
@LTe authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 kernel/delta/module.rb
View
13 kernel/delta/module.rb
@@ -109,14 +109,15 @@ def prepend_features(klass)
mod = self
changed = false
- # Check for a cyclic include
- if mod == klass
- raise ArgumentError, "cyclic include detected"
- end
-
while mod
+
+ # Check for a cyclic prepend
+ if mod == klass
+ raise ArgumentError, "cyclic include detected"
+ end
+
add = true
- k = klass.direct_superclass
+ k = klass.superclass_root ? klass.superclass_root : klass
while k
if k.kind_of? Rubinius::IncludedModule
Please sign in to comment.
Something went wrong with that request. Please try again.