Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

validate_uniqueness_of meaningless error

#2164

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">

Reported by nachocab (at gmail) · March 7th, 2009 @ 05:56 PM

State: wontfix
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Title changed from [PATCH] validate_uniqueness_of meaningless error to validate_uniqueness_of meaningless error

    March 8th, 2009 @ 12:17 AM

  2. Pratik
    Pratik
    • 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.

    March 8th, 2009 @ 12:22 AM

  3. nachocab (at gmail)
    nachocab (at gmail)

    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

    March 8th, 2009 @ 09:04 PM