Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR Calculations group by multiple fields #18

Closed
wants to merge 0 commits into from
Closed

AR Calculations group by multiple fields #18

wants to merge 0 commits into from

Conversation

acatighera
Copy link
Contributor

The :group option is broken for multiple fields when performing an AR calculation. See the example below:

Account.count(:all, :group => 'firm_id, credit_limit')
# returns <OrderedHash {60=>1, 55=>1, 50=>1, 53=>1}>
# should return <OrderedHash {[2, 60]=>1, [nil, 50]=>1, [9, 53]=>1, [6, 55]=>1, [1, 50]=>1, [6, 50]=>1}>

The behavior for grouping by a single field or an association is unchanged. Also, the :group option still takes in a string as always.

@mikel
Copy link
Member

mikel commented Sep 12, 2010

Hi, thanks for the pull request, but you need to rebase your version of 2-3 first, hard to see which one out of the 400 commits we were just sent is the one you want :)

Please send again with a clean branch.

Mikel

@acatighera
Copy link
Contributor Author

Woops! Thank you for pointing that out, I just re-submitted.

Alex

mislav pushed a commit to mislav/rails that referenced this pull request Jan 9, 2014
seuros pushed a commit to seuros/django that referenced this pull request Aug 12, 2014
Whitelist legal job parameter types
kangkyu pushed a commit to kangkyu/rails that referenced this pull request Jul 3, 2016
zzak referenced this pull request in zzak/rails Jan 22, 2023
Revert "Use "mariadb:10.7" to workaround CI failure"
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants