This project is archived and is in readonly mode.

#2164 ✓wontfix
nachocab (at gmail)

validate_uniqueness_of meaningless error

Reported by nachocab (at gmail) | March 7th, 2009 @ 05:56 PM | in 2.x

Added new error to warn against validating a non-existent column.

Currently doing this, raises this error:

Topic.validates_uniqueness_of(:item) #instead of:item_id Topic.create(:item => Item.new)

NoMethodError Message: <"undefined method text?' for nil:NilClass">

Comments and changes to this ticket

  • Pratik

    Pratik March 8th, 2009 @ 12:17 AM

    • Title changed from “[PATCH] validate_uniqueness_of meaningless error” to “validate_uniqueness_of meaningless error”
  • Pratik

    Pratik March 8th, 2009 @ 12:22 AM

    • Assigned user set to “Pratik”
    • State changed from “new” to “wontfix”
    • Patch shouldn't be changing things not related to the ticket.
    • I think it's best to leave out such error warnings. No other validations are doing it, so no point in making an exception for validate_uniqueness_of

    Thanks.

  • nachocab (at gmail)

    nachocab (at gmail) March 8th, 2009 @ 09:04 PM

    Thank you Pratik, I understand that if you let inconsistent code creep in once, you're much more likely to do it again next time. Hope to code something better next time.

    Thanks

    Nacho

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages