This project is archived and is in readonly mode.
undefined method `zero?' for #<OrderedHash {}>
-
Andrew White
- State changed from new to open
- Milestone set to 3.0.6
- Assigned user set to Andrew White
- Importance changed from to Low
A good place to start would be the empty? method declaration in ActiveRecord::Relation - it does a count.zero? which because you're grouping returns an ordered hash rather than a simple count.
Do you want to try to make a patch?
-
Chris Oliver
Thanks Andrew! I will try to make a patch today.
-
Chris Oliver
Hey Andrew,
I got it working pretty easily through this patch: https://github.com/excid3/rails/commit/c360ae189cf5c6fa640c24634922...
-
Chris Oliver
Created a pull request as well: https://github.com/rails/rails/pull/218
-
Andrew White
Turns out that this is a duplicate of #5829 ActiveRecord::Relation#empty? fails for grouped relations, as OrderedHash is ...
-
Dan Pickett
- State changed from open to duplicate
I've added a note on #5829 ActiveRecord::Relation#empty? fails for grouped relations, as OrderedHash is ... referencing Chris' pull request. Closing this out as a duplicate.