title: How to increment counter in Ruby loop
body: <p>For my Rails application I am trying to build a rake task that will populate the database with 10 <code>invoices</code> for each <code>user</code>:</p>
  
  <pre><code>def make_invoices
    User.all.each do |user|
      10.times do
        date = Date.today
        i = user.invoices.create!(:number =&gt; user.next_invoice_number,
                                  :date   =&gt; date += 1.year)
        i.save
      end
    end
  end
  </code></pre>
  
  <p>How can I increment the <code>date</code> by one year?</p>