Re: DRY for ActiveRecord w/PostgreSQL : defaults and validations

Michael Schuerig
Mon, 19 Sep 2005 14:11:03 -0000

On Monday 19 September 2005 15:38, Grant Johnson wrote:
> That said, would it make sense, when generating a model, to place any
> database constraints and relationships in the model?   not
> null=validates presense of, char(2)= validates length of, foriegn
> key=belongs to, etc.

For what it''s worth, that''s what I''m doing in
BoilerPlate[*] for
validates_presence_of and validates_length_of

Michael

[*] http://www.schuerig.de/michael/boilerplate/

--
Michael Schuerig                 Nothing is as brilliantly adaptive
mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org       as selective
stupidity.
http://www.schuerig.de/michael/    --A.O. Rorty, The Deceptive Self