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 #19

Closed
wants to merge 1 commit into from
Closed

AR Calculations group by multiple fields #19

wants to merge 1 commit 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.

@acatighera
Copy link
Contributor Author

any updates on for this?

@lilishane lilishane mentioned this pull request Jan 15, 2012
mislav pushed a commit to mislav/rails that referenced this pull request Jan 9, 2014
kangkyu pushed a commit to kangkyu/rails that referenced this pull request Jul 3, 2016
errata : send_date -> send_data
zzak referenced this pull request in zzak/rails Jan 22, 2023
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

1 participant