From: Yossef Mendelssohn Date: 2009-08-15T00:24:27+09:00 Subject: Re: Class method aliased in superclass bypasses subclass overrides On Aug 14, 9:35 am, Marcos wrote: > So what is it about "alias" that bypasses the override?   Do I have to > replace my aliases with extra wrapper methods to get the behavior I'm > looking for? As far as I can tell (or explain), alias and alias_method work by creating a new copy of the method. One way to think about it is if you had the block stored in a variable because you created the first method like so class Blah meth = Proc.new { puts 'hi' } define_method :first, &meth end Then aliasing the method like `alias :copy :first` is the same as `define_method :copy, &meth`. I ran into problems with the same sort of behavior when I was trying to test-drive an addition of a simple alias for a complicated method, and I assumed that I could simply test that calling the alias called the original method with the same arguments. Nope! Calling the alias went through the same complicated steps as the original. So I changed the alias_method line to a wrapper function and went on my merry way. -- -yossef