title: Rails timestamp saving
body: <p>I have an application hat requires some updating every 5 minutes and I've got this in the application controller:</p>
  
  <pre><code># update last action &amp; yet to implement updating vitals
  def page_update
    if current_user
      current_user.last_page_load = DateTime.now
      interval = 300
      ime_difference = Time.now.to_i - current_user.vitals_update
      updates = time_difference / interval
      # use updates as a multiplier here for any data
  
      current_user.vitals_update = Time.now.to_i
      current_user.save
    end
  end
  </code></pre>
  
  <p>The intention is to store a timestamp of the last update and calculate the multiplier for any changes. Some reason I'm having problems with the timestamps and I don't know what to do.</p>
  
  <p>I've tried outputting the values with no luck, it seems when I try and set</p>
  
  <pre><code>current_user.vitals_update = Time.now.to_i
  </code></pre>
  
  <p>I get an error that says</p>
  
  <blockquote>
    <p>undefined method `change' for 387426:Fixnum</p>
  </blockquote>