Uniqueness not validated after ActiveRecord#dup #5953

Closed
dleavitt opened this Issue Apr 24, 2012 · 0 comments

Projects

None yet

2 participants

@dleavitt

Failing test case:

def test_dup_validity_is_independent
  Topic.validates_presence_of(:title)
  t1 = Topic.new("title" => "Literature")
  t1.save!
  t2 = t1.dup
  t2.title = nil
  assert t2.invalid?, 'topic should be invalid'
end
@dleavitt dleavitt added a commit to dleavitt/rails that referenced this issue Apr 24, 2012
@dleavitt dleavitt add failing test case for #5953 2ab179a
@acapilleri acapilleri pushed a commit to acapilleri/rails that referenced this issue Apr 29, 2012
angelo giovanni capilleri ActiveRecord dup, create a new ActiveModel::Errors istance, in one co…
…mmit, fixed #5953
6486369
@acapilleri acapilleri added a commit to acapilleri/rails that referenced this issue May 15, 2012
@acapilleri acapilleri clean the errors if an object that includes validations errors is dup…
…ed,for 3-2-stable

It Fixes #5953 in 3-2-stable, it's the same pull request of #6284
396e383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment