I have a Seller model that has_many Items.
I want to get the total sale price of all of a Seller\'s items.
In seller.rb I have
def total_item
items.map(&:sale_price).compact.sum
or
items.map(&:sale_price).sum(&:to_i)