03-12-2011, 09:36 PM
Another thing that you might be careful: don't use aliases with methods that exists only on the parent classes.
#WrongThis will return the stack level too deep error if you press F12.
Instead use the super
#Wrong
Code:
class Parent_Class
def method(*args)
#anything
end
end
class Child_Class < Parent_Class
alias old_method method
def method(*args)
old_method(*args)
#anything
end
end
Instead use the super
Code:
class Parent_Class
def method(*args)
#anything
end
end
class Child_Class < Parent_Class
def method(*args)
super(*args)
#anything
end
end