New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include? in ActiveRecord::Associations::CollectionProxy return 1 instead of true #10979
Comments
I'll take a look. |
I can confirm this behavior, I rewrote the
|
I did some research and it's enough if question mark methods return a I'm closing this one as the described behavior is alright. Thanks for reporting 💛 |
This one may be different, because this predicate for whatever reason documents that the singleton I would revise in this case the return value to keep backwards compatibility (instead of relaxing the contract). |
@fxn thanks, I'm on it. |
👍 |
Foo has_many Bars
Foo.first.bars.include? bar
If false, it returns false
If true, it returns 1
When I do this,
the_bars = Foo.first.bars
the_bars.include? bar
if true, it returns true.
I am reproducing this in Rails 4.
The text was updated successfully, but these errors were encountered: