This project is archived and is in readonly mode.

#5978 ✓committed
kyanagi

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) &&
        comparison_object.id == id && !comparison_object.new_record?)
  end

In 3.0.2:

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

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages