Untitled

 avatar
unknown
ruby
3 years ago
211 B
7
Indexable

daily_spent
  Post.where("collected_at BETWEEN ? AND ?", Time.current.beginning_of_day, Time.current.end_of_day).map { |i| i.credit_cost }.sum
end

def credit_cost
  (batch_small * 3) + (batch_large * 30)
end

Editor is loading...