#976 ✓ resolved
kematzy

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Attachments

Referenced by

Pages