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. Also fixed a similar problem in
AR reflections.
Merge pull request #14526 from chancancode/fix_ar_equality

Ensure we are returning either `true` or `false` for `#==`