Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
Fully Compatible
Description
After these changes MONGOID-4890, we have #any? method, which has the wrong behavior:
roles = user.roles.where(name: 'admin') |
|
user.roles.any? { |role| role == 'user' } # => true |
That happens because `#any?` method doesn't check block.
We need to add
return super if block_given? |
right after def any?
Attachments
Issue Links
- is caused by
-
MONGOID-4890 Destroying model instances with dependent associations in transactions raises OperationFailure due to use of (deprecated) count
-
- Closed
-
- is related to
-
MONGOID-4959 Document any? in tutorial
-
- Closed
-