Accessing an ActiveRecord object's validation list

Is there a way to access an ActiveRecord object’s validation list?
for instance:

u = User.find 1
u.attributes.each { |attr| puts attr if u.validates_presence_of?(attr) }

I’m building a test_scaffold generator and I want to access the list of
validations for a model so that I can build the appropriate tests.

Thanks,

-Michael Cowden
StoryRight.com
[email protected]
(443) 519-8662

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs