In PostgreSQL,

Model.select(:MAX[:time], :MAX[:version], :deployment_id).group(:deployment_id)

calls the query:

SELECT MAX("time"), MAX("version"), "deployment_id" FROM models GROUP
BY "deployment_id"

which returns two columns that are named max.

When this is returned as a list of hashes, one "max" column clobbers
the other "max" column, resulting in values that have only one :max
key.

Maybe the best way to fix this would be to give default AS names for
all function calls:

so :MAX[:time] would become :MAX[:time].AS("max_time") by default,
unless another AS("xyz") is passed in.

What do you think?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to