Re: Re: validates_associated ... doesn''t

Fraser Campbell
Wed, 26 Oct 2005 19:03:06 -0000

Mark Reginald James wrote:

> With a junk club_id the value of member.club is nil because the
> record can''t be found, and validates_associated treats this as
> unassigned and hence valid.
>
> Instead, replace both the above validate helpers with
>       validates_presence_of :club

Validation now works.  It doesn''t strike me as intuitive, perhaps we
need validates_associated_and_exists :-)

Thx,
Fraser