[Rails] [ANN] Validation Reflection plugin
Michael Schuerig
michael at schuerig.de
Fri Jul 28 21:20:06 GMT 2006
The validation reflection plugin adds three things
(1) Reflective access to validations
- ModelClass.reflect_on_all_validations
- ModelClass.reflect_on_validations_for(:property)
(2) It provides "declarative" methods for defining
validations based on database metadata
- validates_presence_of_mandatory_content_columns
- validates_lengths_of_string_attributes
- validates_all_associated
(3) It reflects validation information into the class attributes of
of HTML elements generated from rhtml templates.
See test/instance_tag_validations_test.rb for what this looks like.
Yes, for validates_format_of it gets nasty.
Installation:
$ script/plugin install \
http://www.schuerig.de/michael/rails/validation_reflection
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
More information about the Rails
mailing list