diff options
author | Xavier Noria <fxn@hashref.com> | 2013-08-19 14:17:49 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-08-19 14:38:20 +0200 |
commit | 565c367d344228211f03d7736de79d1cfff26422 (patch) | |
tree | 6fa5161b4164b94a8e036318b7a006d6716dec28 /actionview/CHANGELOG.md | |
parent | 2fcef6678a02fc03aa3ee18ad2d056e093551bd2 (diff) | |
download | rails-565c367d344228211f03d7736de79d1cfff26422.tar.gz rails-565c367d344228211f03d7736de79d1cfff26422.tar.bz2 rails-565c367d344228211f03d7736de79d1cfff26422.zip |
let AR::FinderMethods#exists? return singletons in all cases [closes #11592]
This fixes a regression. The documentation said in its introduction
paragraph that the method returns truthy/falsy, but then below it
was said that if there were no arguments you'd get `true` or `false`.
Also when the argument is exactly `false` a singleton is documented
to be returned.
The method was not returning the singletons so it didn't conform to
those special cases.
The best solution here seems to be to just return singletons in all
cases. This solution is backwards compatible. Also, the contract
has been revised because it has no sense that the predicate varies
that way depending on the input. I bet the previous contract was just
an accident, not something mixed on purpose.
Conflicts:
activerecord/lib/active_record/relation/finder_methods.rb
activerecord/test/cases/finder_test.rb
Diffstat (limited to 'actionview/CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions