Sunday, July 4, 2010

[Rails] Re: validates_uniqueness_of fails on update

Please provide more information about (or just check) your migration
and model and its associations.

In the meantime, ActiveRecord skips the check on the record/row (not
the column) on Update. Here's the relevant text:
"When the record is created, a check is performed to make sure that no
record exists in the database with the given value for the specified
attribute (that maps to a column). When the record is updated, the
same check is made but disregarding the record itself. "

Have you verified your data, that there is only one record in the
table with that value?

D.

On Jul 3, 11:15 pm, Me <chabg...@gmail.com> wrote:
> According to the docs when you validate on uniqueness it is supposed
> to skip the check on the column.  I am getting failed validation on
> updates for some reason.  Rails 2.3.5

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate