Hello list,

In light of this recent change:

--- lib/active_record/base.rb   (revision 4551)
+++ lib/active_record/base.rb   (revision 4552)
@@ -1646,8 +1646,9 @@
       def ==(comparison_object)
         comparison_object.equal?(self) ||
           (comparison_object.instance_of?(self.class) &&
-            comparison_object.id == id &&
-            !comparison_object.new_record?)
+ ((!comparison_object.new_record? && comparison_object.id == id) || + (comparison_object.new_record? && comparison_object.attributes == attributes))
+          )
       end


this test needs amending:

test/base_test.rb (revision 4553):
  def test_equality_of_new_records
    assert_not_equal Topic.new, Topic.new
  end

because those two new Topics are now considered equal.

Just a heads-up to anyone else who, like me, missed this change, and was a bit confused by the failing test...

Cheers,
Chris

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to