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

Support for least and greatest #148

Closed
cyrusstoller opened this issue Nov 13, 2012 · 4 comments
Closed

Support for least and greatest #148

cyrusstoller opened this issue Nov 13, 2012 · 4 comments

Comments

@cyrusstoller
Copy link

It would be awesome if arel supported least and greatest.

Here's the documentation I've found for postgres and mysql.

http://www.postgresql.org/docs/current/static/functions-conditional.html#FUNCTIONS-GREATEST-LEAST
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_least

I'd be up for trying to write a pull-request, any hints on where to start? I'm guessing that I'd need to make a new node in lib/arel/nodes as a subclass of Function or at the bottom of lib/arel/nodes/function with Sum, Max, Min, etc ...

@ernie
Copy link
Collaborator

ernie commented Nov 13, 2012

ARel already has a NamedFunction node that can be used for any functions like this -- is it not working for you?

@cyrusstoller
Copy link
Author

Sorry for the late reply. I guess I could just use the NamedFunction. It's more of a convenience thing than anything else.

@mikegee
Copy link

mikegee commented Sep 18, 2013

@cyrusstoller Does this issue need to remain open?

@cyrusstoller
Copy link
Author

Not really. Thanks for checking in.

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

No branches or pull requests

3 participants