Hi all,
I understand that the documentation to the Rails 3.0.0 validates method is in ActiveModel::Validations::ClassMethods http://www.railsapi.com/doc/rails-v3.0.0/classes/ActiveModel/Validations/ClassMethods.html#M003721
I was wondering then, how a class that inherits from ActiveRecord::Base has the validates method?
For example, it is common to use validates in such a way:
class User < ActiveRecord::Base
attr_accessible :name, :emailvalidates :name, :presence => true
end
I looked at the class hierarchy and it seems like
SomeModelClass extends ActiveRecord::Base extends Object
How is a method in Active::Validations::ClassMethods available to the model object that inherits from ActiveRecord::Base ?
Thanks a lot for your help!