On 21 Aug 2008, at 19:05, vince
<sthapit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> I''m using restful_authentication to let users register and login.
> Lately, however, I''m seeing multiple login and emails being
created
> even though I have validates_uniqueness_of as below:
>
Have you checked they don''t differ only by a space or something? Other
than that validates_uniqueness_of is vulnerable to race conditions. If
you want a 100% reliable enforcement of this, use a unique
index.> user.rb
> validates_uniqueness_of :login, :email, :case_sensitive => false
>
>
> mysql> select id, login, email, created_at, state from users;
> +----+---------------+----------------------------
> +---------------------+---------+
> | id | login | email |
> created_at | state |
> +----+---------------+----------------------------
> +---------------------+---------+
> | 1 | sthapit | changed-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
| 2008-02-08
> 06:15:00 | active |
> .
> .
> .
> | 34 | changed1 | changed1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
| 2008-07-20
> 06:35:35 | pending |
> | 35 | changed1 | changed1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
| 2008-07-20
> 06:35:40 | active |
> | 38 | changed2 | changed2-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
| 2008-08-15
> 11:40:38 | pending |
> | 39 | changed2 | changed2-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
| 2008-08-15
> 11:40:43 | pending |
> .
> .
> +----+---------------+----------------------------
> +---------------------+---------+
>
> If anyone has an idea why this is happening it would be very
> appreciated. (login and emails changed in the table above, but id,
> created_at, and state are accurate).
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---