Does anyone, by chance, know how to obtain a list of all the defined activerecord validations at runtime? In other words, I''d like to query a model for all the fields that are unique, or required. I found this: read_inheritable_attribute(:validate), but it seems to be deprecated in later versions of rails. Thanks so much for any insight. -- Posted via http://www.ruby-forum.com/.
On Wednesday 15 July 2009, Will Grundler wrote:> Does anyone, by chance, know how to obtain a list of all the defined > activerecord validations at runtime?http://rubyforge.org/projects/valirefl/ http://github.com/mschuerig/validation_reflection/tree/master HTH, Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/
Thanks Michael! That''s a big help. Michael Schuerig wrote:> On Wednesday 15 July 2009, Will Grundler wrote: >> Does anyone, by chance, know how to obtain a list of all the defined >> activerecord validations at runtime? > > http://rubyforge.org/projects/valirefl/ > http://github.com/mschuerig/validation_reflection/tree/master > > HTH, > Michael > > -- > Michael Schuerig > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org > http://www.schuerig.de/michael/-- Posted via http://www.ruby-forum.com/.