I’m trying to understand this by going through the source, but I don’t.
I know that these validation helpers are implemented as class methods,
presumably ‘extend’ is being called somewhere in ActiveRecord::Base in
order to effect that.
But I would then think that I should be able to say
in my class definition in order to get the validation helpers accessible
at the instance level. When I do that I get the following error when
validate is called:
SystemStackError: stack level too deep
validates_presence_of' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:402:ineach’
validates_presence_of' from script/../config/../config/../app/models/web_user.rb:62:invalidate’
send' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:403:invalidates_presence_of’
… 6446 levels…
Some sort of recursion is happening, but I’m at the end of my Ruby
abilities. Any help would be much appreciated. I’m trying to be DRY (or
at least not repeat others), but if I can’t figure this out soon I’ll
just have to rewrite the validations I need manually.