This project is archived and is in readonly mode.
size method ignores "group by" on has_many
-
Assaf Arkin
I'm pretty sure this used to work before, 2.1.0 and edge.
-
Emilio Tagua
- Tag changed from activerecord, bug, has_many to activerecord, bug, has_many, patch
Here is the patch to fix this, includes a test to verify that the :group option is included when the target hasn't been loaded.
-
Repository
- State changed from new to committed
(from [dc8bf7515de85f5bc28d17e96edf4a3e74a858da]) When counting grouped records the target should be loaded to return a valid groups count result.
Without this change count_records will group for the count in the query and return erroneous results.
Signed-off-by: Michael Koziarski michael@koziarski.com [#937 size method ignores "group by" on has_many state:committed] http://github.com/rails/rails/co...
