Hi,

Currently uniqueness validator uses database queries which not work for nested 
forms.


For example, I have a company form which have many partners and each partner 
have a person and a percentage.

Using uniqueness validator, I can not guarantee someone will not be a partner 
two times because the partners aren't on database yet.


We've implemented a validator similar to this one: 
http://pastie.org/private/osa3pmono5l1ykrd7vipwa


I'm not sure if the uniqueness validator should handle it.

Take a look: http://pastie.org/private/maxdpn4gmvftzcl2ka0mq


I'm not sure if it will be too complex to the proposal of uniqueness validator 
but that is a common validation for each system I've worked in last years.

WDYT? Something like that should be on the active record or a gem?

Cheers,

Gabriel Sobrinho
gabrielsobrinho.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to