Ruby 2 (not 1.9.3) specific issue with AR when calling alias_method'd destroy vs. super in module-included instance destroy

There is probably a simple reason for this, but haven’t figured it out yet.

If you alias_method destroy on an AR model and then call that method from a module included destroy, it works fine in Ruby 1.9.3 but not Ruby 2.0.0-p247.

The workaround is to call super instead. I’m curious as to why this depends on the Ruby version.

Here is the project to reproduce. I know it is a fringe usage case:


Thank you for a fun report Gary!

We drilled down the problem and we actually could reproduce the same
behavior "off Rails".
So I just filed an issue on the Ruby bug tracker.
I guess you hit a hidden Ruby bug!

And the bug was just fixed via r44175.
So your code would work under Ruby 2.1 which will be shipped at Christmas this month :slight_smile: