Thanks Fred.

What do you mean by 'use a unique index'?

What I am concerned about is logical uniqueness, i.e., persist only
data objects with a unique combination of attributes.

Thanks,

Grar

On Feb 22, 3:54 pm, Frederick Cheung <[email protected]>
wrote:
> On Feb 22, 8:52 pm, Grary <[email protected]> wrote:
>
> > Hi,
>
> > From a model class, what is the standard way of ensuring uniqueness
> > across multiple columns (attributes) simultaneously?
>
> > In other words, I want to ensure only unique "rows" are persisted to
> > storage. I feel like there must be a straightforward way to do this.
> > Any suggestions?
>
> validate_uniqueness' scope option does this (but you should really be
> using a unique index as well.)
>
> Fred
>
> > Thanks,
>
> > Grar

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to