Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5978

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?

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

State: committed
Milestone: none
Assigned to: nobody
Importance: none