On 6/29/07, Adwin W. [email protected] wrote:
It also happen with Migration, I couldnt found it.
I read from the source (.rb) as well … and I have no clue …
Thank you !
Module is a (partial) equivalent to Java’s Interface. It can contain
constants and methods (and, unlike Interfaces, method implementation
as well). You cannot derive from it, so it’s kind of dead end. You can
however, include one module into another.
So they are kind of building bricks from which you can compose your
Now to the methods:
There are several kinds of methods: instance methods, class methods
and singleton class methods. (They are in fact the same, but they
differ to what object they belong and how you invoke them).
These validation methods are class methods of the ActiveRecord::Base,
and you can find them in some ClassMethods module somewhere in the
ActiveRecord sources . This module is then included into AR::Base
Many of the “magic” methods are implemented using method_missing, that
is called whenever a method is not found, before raising exception
To see the what methods a class has, startup rails console , and
issue ActiveRecord::Base.methods.sort (for class methods)
and ActiveRecord::Base.instance_methods.sort (for instance methods)
I will leave up to you to lookup the details of  and