I'm trying total up all "amount" columns with a definition in the model like so:
def self.total
self.all.collect(&:amount).sum
end
With that, "Recipe.total" works as expected. However, I'm using a plugin that passes "Recipe.find(:all)", and I can't seem to pass that to the method to find the total. That is:
Recipe.find(:all).total # doesn't work
Is there a way to define the method in my model differently to make Recipe.find(:all).total work like Recipe.total?