#139 invalid
Adam French

[Patch] validates_uniqueness_of should not interfere with object destruction

Reported by Adam French | January 28th, 2008 @ 05:27 PM


'Validatable::ValidatesUniquenessOf should not interfere with the destruction of an object' FAILED

expected: true,

got: false (using ==)


Comments and changes to this ticket

  • asceth

    asceth January 30th, 2008 @ 02:59 AM

    In the spec Project is used but that table is paranoid (has :deleted_at) therefore when Project#destroy! is called the data_object_adapter actually only saves the instance with the deleted_at time causing the whole thing to fail since #save is also calling #valid? which now fails with the new validation which means #destroy! returns false.

    If this was intended to be brought out by the spec then DataObjectAdapter#delete could do #save_without_validation on paranoid tables.

    Hope that makes sense.

  • jmoses

    jmoses February 11th, 2008 @ 05:57 PM

    • Title changed from “validates_uniqueness_of should not interfere with object destruction” to “[Patch] validates_uniqueness_of should not interfere with object destruction”

    Attached patch to fix issue raise in `validates_uniqueness_of` spec. Additionally fixed (related?) issue in `spec/save_command_spec.rb` where attempting to exercise a `before_create` trigger failed because of a name collision.

  • Dan Kubb (dkubb)
  • Sam Smoot

    Sam Smoot April 28th, 2008 @ 01:01 PM

    • Assigned user set to “Adam French”

    Adam, can you make sure/verify this is specced in 0.9.0 and close if it no longer applies?

  • Sam Smoot

    Sam Smoot May 20th, 2008 @ 09:30 PM

    • State changed from “new” to “invalid”

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 »

People watching this ticket