On 31 Dec 2008, at 23:30, [email protected] wrote:
>
> On Dec 31, 2:58 pm, Frederick Cheung <[email protected]>
> wrote:
>> Validations about uniqueness of things are prone to race conditions.
>> If you need a cast iron guarantee that can only come from the
>> database
>> itself (ie unique index etc...)
>
> The app allows an "anonymous" user to have multiple reviews of a
> business, so a DB level constraint probably isn't appropriate. But
> regardless, my question is about what I can/can't expect from AR with
> respect to transactions/validations. If validations aren't within the
> transaction they're not useful. Since I don't believe the Rails folks
> are stupid, I'm trying to figure out what I'm doing wrong here.
>
It should be easy to work out whether they run in a transaction or not
by looking at the log files. Most validations are just about the one
object and so couldn't care less. Even if they are it wouldn't help
your uniqueness validations (unless you're actually locking rows)
Fred
> Thanks,
>
> pt.
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---