
Unexpected behaviour in DataMapper::Collection when using blank?
Reported by kematzy | July 14th, 2009 @ 11:56 PM | in 0.10.0
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
-
Dan Kubb (dkubb) July 16th, 2009 @ 01:22 AM
- 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.
[#976 state:resolved] http://github.com/datamapper/dm-core/commit/2e4536cab3614454af8f4d8...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Attachments
Tags
Referenced by
-
976 Unexpected behaviour in DataMapper::Collection when using blank? [#976 state:resolved] http://github.com/datamapper/dm-co...