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.

validation on serialize :some_column is not working

#3454

Declaring a column as serialized via "serialize :some_column" and trying to have it validated, e.g. "validates_uniqueness_of :some_column", will not get validated properly, resulting in the creation of a duplicate entry.

Reported by Alex Vaystikh · November 2nd, 2009 @ 10:41 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Dylan McClung
    Dylan McClung

    validates_uniqueness_of uses to_s for text columns, but the value passed to the validator is the marshalled object. The to_s result is compared to the yaml, which will never be equal unfortunately.

    January 8th, 2010 @ 03:57 AM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to

    October 8th, 2010 @ 11:53 AM