title: Stack level too deep and before_save
body: <p>Okay, this thing is driving me crazy. I've got a small method that looks roughly like this:</p>
  
  <pre><code>class PdfResult &lt; ActiveRecord::Base
    attr_accessible :press_ready_url, :low_resolution_url, :error_code,
                    :document_id
  
    before_save :update_values
  
    def created?
      return true if press_ready_url.present? &amp;&amp; low_resolution_url.present?
    end
  
    def error?
      error_code == 201 || error_code == 204 ? false : true
    end
  
    private
  
    def update_values
      return if error?
      self.updated_at = Time.now
      if created?
        self.error_code = 201
      else
        update_attributes(press_ready_url: nil, low_resolution_url: nil)
        self.error_code = 204
      end
      save!
    end
  end
  </code></pre>
  
  <p>And my <code>error</code> method just causes <code>stack level too deep</code> errors. Can someone help me understand why? By my logic it should work just fine. Thanks. Do I need to guard against <code>error_code</code> changing somehow?</p>