Since I refactored
Invoice#outstanding yesterday, I can now build on that to refactor
1 2 3
class Invoice = self.amount end end
1 2 3 4 5
class Invoice < ActiveRecord::Base def fully_paid? outstanding <= 0 end end
A nice side benefit of this refactoring is that since
#outstanding it will also get the performance boost from using the SQL sum.