Hey all,
Ive been looking at the AR source code and wondering something. There is
heavy use of (for example)
class Base
class << self
#Â definitions
end
end
Now, I can see that this is how we get our nice syntax for model
validations and so forth - but what I dont get is how that actually
works behind the scences.
I found this post
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/57252
detailing what that syntax means in detail, and I get that. But what
confuses me, is how if the validations are class methods, are they
validating instances of that class? What is actually going on behind the
scenes?
If anyone can shed any light on this I would be very grateful
Cheers
Tim