Average. Maximum. Minimum on empty Associations should also return 0 like Sum

Hi

I was working with an association the other day in Rails 2.1.0 and found that using association.average(:value) returned nil when the association was empty.

I found that for association.sum(:value) this was changed:

http://rails.lighthouseapp.com/projects/8994/tickets/295-sum-on-associations-should-return-0-when-no-rows-are-returned

So in the same manner I would like to propose that average, maximum, and minimum also return zero instead of nil when the association is empty.

I have a patch and tests:

http://rails.lighthouseapp.com/projects/8994/tickets/1516-average-maximum-minimum-on-associations-should-return-0-when-no-rows-are-returned

This is the first time I have attempted to contribute to Rails so feedback very welcome.

Cheers Shane