Count uniques?

I need to know how I use the count function to have a sum of days
ie: I have several transactions in several days like hmmm Tasks
Task -> id, price, day , description

so in every day I did some tasks
I sum them with the Task.sum(:price)
but I want to do an automatized way to have an average description (sum
/ days )
how can I do it ?
ps: day is datetime …

You can substract datetimes to get the difference between them in
seconds.
Time.now - Time.now
Use that to average?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs