Ruby on Rails Sum Null

items.map(&:sale_price).compact.sum
# or
items.map(&:sale_price).sum(&:to_i)
patrick204nqh