Untitled
Anonymous
ruby
10/08/2022 4:32 PM
284 B
28
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...