rails/rails — pull request #14526 by chancancode (2014-03-29 11:33:53+00:00)
Title: Ensure we are returning either +true+ or +false+ for +#==+

460eb83d cused +ActiveRecord::Base#==+ to sometimes return +nil+ in some cases,
this ensures we always return a boolean value.

This broke a test on discourse when testing against 4.1.0.rc2, see https://github.com/chancancode/discourse/issues/1.

I also fixed a similar problem in AR reflections. That condition doesn't seem to be currently tested, and I'm not sure if it's worth adding a specific test for this, but the change seems safe. If we want to make sure that's tested, I can investigate and add that.

I checked other definitions of `#==` within the codebase for similar problem by inspecting the code and from our existing test suite (see https://travis-ci.org/rails/rails/builds/21779437). I believe these should be the only two instances of the same problem.

cc @fxn @tenderlove