diff options
-rw-r--r-- | lib/did_you_mean/core_ext/name_error.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/did_you_mean/core_ext/name_error.rb b/lib/did_you_mean/core_ext/name_error.rb index 77dcd520c0..74febccfe9 100644 --- a/lib/did_you_mean/core_ext/name_error.rb +++ b/lib/did_you_mean/core_ext/name_error.rb @@ -1,7 +1,14 @@ module DidYouMean module Correctable + SKIP_TO_S_FOR_SUPER_LOOKUP = true + private_constant :SKIP_TO_S_FOR_SUPER_LOOKUP + def original_message - method(:to_s).super_method.call + meth = method(:to_s) + while meth.owner.const_defined?(:SKIP_TO_S_FOR_SUPER_LOOKUP) + meth = meth.super_method + end + meth.call end def to_s |