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
Reject the nil values. items.to_a.reject{|x| x.sales_price.nil?}.sum(&:sale_price)
items.to_a.reject{|x| x.sales_price.nil?}.sum(&:sale_price)