title: change year for a date in Rails
body: <p>I have a form that gets the birthday of a user.</p>
  
  <p>I want to take the birthday and store it in another attribute but take the current year.</p>
  
  <p>I do this in a call back </p>
  
  <p>Model board</p>
  
  <p>before_save :set_delivery_date</p>
  
  <pre><code>def set_delivery_date
  
  self.delivery_date = self.birthday
  self.delivery_date.change(:year =&gt; Time.now.year)
  end
  </code></pre>
  
  <p>The birthday is 1920-07-27</p>
  
  <p>This does not seem to change the date.</p>
  
  <p>Anyone know how to do this?</p>
  
  <p><strong>Update</strong></p>
  
  <p>The following works I can see the new date in the database:</p>
  
  <pre><code> self.deliver_on = self.birthday.change(:year =&gt; Time.now.year)
  </code></pre>
  
  <p>However when I try to do rspec tests or I try it in the console it produces the following error:</p>
  
  <pre><code>ArgumentError: invalid date
  </code></pre>
  
  <p>anyone know why this is happening?</p>