#1121 ✓resolved
Roger Braun

Collection#count does not work after building a Collection with Collection#union

Reported by Roger Braun | November 11th, 2009 @ 01:14 PM

If you build a Collection as a union of two other Collections and try to count it, you receive the error +options[:fields]+ should not be empty if +options[:unique]+ is false. This is the case even with the union of two empty collections.

Steps to reproduce:

>> @a = Entry.all(:titel => "foo")
=> []
>> @a.count
=> 0
>> @c = Entry.all(:titel => "bar")
=> []
>> @c.count
=> 0
>> @b = @a.union(@c)
=> []
>> @b.count
ArgumentError: +options[:fields]+ should not be empty if +options[:unique]+ is false

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 »

People watching this ticket

Referenced by

Pages