#379 ✓resolved
blizz

multiple warning messages on signup validation

Reported by blizz | February 9th, 2009 @ 11:37 PM | in Hobo 1.0 - Final

I get this message twice if the email_address is already taken.

*  Email Address has already been taken
* Email Address has already been taken

Comments and changes to this ticket

  • Tom Locke

    Tom Locke March 12th, 2009 @ 10:54 AM

    • Milestone set to Hobo 1.0 - Final
    • State changed from “new” to “open”
  • Marcelo Giorgi

    Marcelo Giorgi June 22nd, 2009 @ 07:58 PM

    • Tag changed from signup, validation to defect, signup, validation

    I've made a fix for it on my fork git://github.com/mgiorgi/hobo.git and on my branch: 379_multiple_warning_messages_on_signup_validation

    I've also attached a patch here.

    Basically, the uniqueness of email_address was being checked twice: 1) with the :unique keyword; 2) AND with ':login => true' statement. So, I've just leave the latter.

  • Bryan Larsen

    Bryan Larsen June 23rd, 2009 @ 04:58 PM

    I went to check that your fix didn't remove the :unique => true from schema.rb, but it looks like it was never there in the first place. validates_uniqueness_of is nice, but it's racy -- you also have to include the check in the database. This would be a separate bug, though.

  • Marcelo Giorgi

    Marcelo Giorgi June 23rd, 2009 @ 06:06 PM

    Sorry, maybe I didn't explain the problem clearly.

    But, As I understand, the issue is that both: :unique AND :login parameters check for uniqueness. That's why the message is displayed twice. So I remove the :unique validation, assuming :login would still check for uniqueness.

    In particular my fix is just replacing this line:

     email_address :email_address, :unique, :login => true
    

    Instead of this one:
    @@@ ruby2 email_address :email_address, :login => true

    
    So, as far as I understand schema.rb is not relevant to this issue, isn't it?


    Please tell me, If I am wrong...
  • Tom Locke

    Tom Locke June 23rd, 2009 @ 07:30 PM

    You're fix is fine Marcelo, Bryan is just pointing out that there's another related issue, which we'll put on another ticket. Let me do that right now...

  • Bryan Larsen

    Bryan Larsen November 25th, 2009 @ 01:52 PM

    • State changed from “open” to “resolved”

    This bus has been resolved for a long time.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Attachments

Referenced by

Pages