Unexpected behaviour in DataMapper::Collection when using blank?
I just found this 'bug' in DataMapper::Collection results.
Given that we have 5 albums in DB.
Album.all.blank? => returns false
If we do a scoped search, which returns an empty collection, we should get true returned
Album.all(:parent_id => 2).blank? => expected true, but returns false
I know, you can/should(?) use .empty?, but blank? is a common way of working for many.
Included specs to show the issue.
Comments and changes to this ticket
- State changed from new to resolved
(from [2e4536cab3614454af8f4d8cdd7d59d119ecd9df]) Fixed Collection#blank? to work
- Fixed delegation code in Collection to only forward methods explicitly defined in the model to it, rather than methods that could've been mixed in or inherited from Object.