This project is archived and is in readonly mode.

#2064 ✓resolved
Dmitry Polushkin

[AutosaveAssociation] should not validate associated model if marked_for_destruction

Reported by Dmitry Polushkin | February 24th, 2009 @ 11:33 PM | in 2.3.6

While coding an application based on 2.3RC1 I've stuck with this behaviour:


  def test_should_skip_validation_and_destroy_the_associated_model
    @pirate.ship.update_attribute(:name, '')

    assert !@pirate.valid?
    assert @pirate.reload.valid?

    assert_difference('Ship.count', -1) do
      @pirate.update_attributes({ :ship_attributes => { :id => @ship.id,  :_delete => true } })
    end
    assert @pirate.valid?
  end
end

Should not validate associated model if it were marked_for_destruction.

Comments and changes to this ticket

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>

Referenced by

Pages