This project is archived and is in readonly mode.

#5978 ✓committed

behavior of ActiveRecord::Base#== changes between 3.0.1 and 3.0.2

Reported by kyanagi | November 16th, 2010 @ 12:17 AM

In 3.0.1:

  def ==(comparison_object)
    comparison_object.equal?(self) ||
      (comparison_object.instance_of?(self.class) && == id && !comparison_object.new_record?)

In 3.0.2:

  def ==(comparison_object)
    comparison_object.equal?(self) ||
      persisted? &&
        (comparison_object.instance_of?(self.class) &&
 == id)

new_record? is changed to persisted?.
This is not same when a record is destroyed.
Is this a intended change?

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=""></a>

People watching this ticket

Referenced by