This project is archived and is in readonly mode.
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
-
Repository November 16th, 2010 @ 02:40 PM
- State changed from new to committed
(from [69f7d39945a946dc284bac05fa7aff33159d4e80]) Models should be equals even after destroyed
[#5978 state:committed] https://github.com/rails/rails/commit/69f7d39945a946dc284bac05fa7af...
-
Repository November 16th, 2010 @ 02:41 PM
(from [4718d097ffe3af965f3ea7218156050507eabe4f]) Models should be equals even after destroyed
[#5978 state:committed] https://github.com/rails/rails/commit/4718d097ffe3af965f3ea72181560...
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
- 5978 behavior of ActiveRecord::Base#== changes between 3.0.1 and 3.0.2 [#5978 state:committed] https://github.com/rails/rails/c...
- 5978 behavior of ActiveRecord::Base#== changes between 3.0.1 and 3.0.2 [#5978 state:committed] https://github.com/rails/rails/c...