title: How can I update attributes in after_save without causing a recursion in rails 2.3?
body: <p>I've got a model which has a video attached with <a href="https://github.com/thoughtbot/paperclip" rel="noreferrer">Paperclip</a>. After it saves I use the saved video to generate a thumbnail. I need to do this after every save, even when a new video hasn't been uploaded, because the user can change the time where the thumbnail is captured.</p>
  
  <p>I am currently using after_post_process to do this, but it will only generate the thumbnail when uploading a file (this is a callback which is part of Paperclip).</p>
  
  <p>I would ideally use an after_save callback like this:</p>
  
  <pre><code>after_save :save_thumbnail
  def save_thumbnail
    #generate thumbnail...
    self.update_attributes(
      :thumbnail_file_name =&gt; File.basename(thumb), 
      :thumbnail_content_type =&gt; 'image/jpeg'
    )
  end
  </code></pre>
  
  <p>Unfortunately update_attributes calls save, which then calls the before_save callback causing an infinite loop. Is there a simple way to circumvent this behaviour?</p>