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

Add support for HAVING #483

Closed
perdjurner opened this Issue Apr 25, 2015 · 2 comments

Comments

1 participant
@perdjurner
Contributor

perdjurner commented Apr 25, 2015

Given the simplicity of the Wheels ORM I think we can check for any aggregate calculated properties used in the where argument and place these in HAVING instead.

@perdjurner perdjurner added this to the 1.5 milestone Jun 28, 2015

@perdjurner perdjurner removed this from the 1.5 milestone Aug 20, 2015

@perdjurner perdjurner self-assigned this Mar 23, 2017

@perdjurner perdjurner added this to the 2.0.0 Beta milestone Mar 24, 2017

@perdjurner perdjurner added the docs label Mar 24, 2017

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Mar 24, 2017

Done, just need to find a good place to document the following.

Given an Order model with properties for productId, amount and a calculated property:
property(name="totalAmount", sql="SUM(amount)");

You can do model("order").findAll(group="productId", where="totalAmount > 1000") to get the ids for all products with over $1,000 in sales.

@perdjurner perdjurner removed the enhancement label Mar 24, 2017

@perdjurner perdjurner modified the milestones: 2.0.0, 2.0.0 Beta Mar 24, 2017

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Aug 1, 2017

Documented in findAll.

@perdjurner perdjurner closed this Aug 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment