For my Rails application I am trying to build a rake task that will populate the database with 10 invoices
for each 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
How can I increment the date
by one year?