I have a ruby method (deactivate!) that is on an activeRecord class. However, I can’t seem to find where that method is declared.
There have been numerous developers on this project, so it could be anywhere. There is a deactivate! on an unrelated class, but it doesn’t seem to get called.
Any ideas how to find all the superclasses for an instace, or where to find the code for deactivate!?
When I need to find where a method is declared on some class, say ‘Model’, I do
This searches the ancestor tree in the same order that ruby does for the first that has the method in
instance_methods(false), which only includes non-inherited methods.Note: before ruby 1.9, the methods were listed as strings not symbols, so it would be