Support for least and greatest #148

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

Comments

Projects
None yet
3 participants

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 ...

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?

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

mikegee commented Sep 18, 2013

@cyrusstoller Does this issue need to remain open?

Not really. Thanks for checking in.

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