Re: Validation help

Adrian Madrid
Thu, 08 Sep 2005 16:46:10 -0000

np and thanks!

Adrian Madrid

François Beausoleil wrote:

> Silly me !
>
> Adrian Madrid said the following on 2005-09-07 16:36:
>
>> Now that I think about it I could do record.send(attr) == record.fieldy
>>
>> It works! Here''s the final code:
>>
>> validates_each :fieldx do |record, attr|
>>   record.errors.add attr, ''must be different from
fieldy'' if
>> record.send(attr) == record.fieldy
>> end
>
>
> Yup, after I read your response, I realized my error.  Sorry for the
> mixup, and good work on your part :)
>
> Bye !
> François
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails