I'm looking to perform an average calculation from the sums of two
columns. I can't seem to find a way to alias the output then view that
calculation:
This works, but there has to be a better way:
puts C.select{sum(:breading)/sum(:multiple)}.first.values.first.to_f
What I'm thinking it should look like:
puts C.select{sum(:breading)/sum(:multiple)}.as(:average)
The latter just shows the Sequel object. Inspection shows it has no
columns, even with the alias 'average'.
Is this this doable?
Cheers
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/814a8b73-44a9-49e6-915c-f20ff529fe70%40googlegroups.com.