invoices
对于我的 Rails 应用程序,我正在尝试构建一个 rake 任务,该任务将为每个数据库填充 10个user
:
def make_invoices
User.all.each do |user|
10.times do
date = Date.today
i = user.invoices.create!(:number => user.next_invoice_number,
:date => date += 1.year)
i.save
end
end
end
我怎样才能增加date
一年?