title: Getting ActiveRecord association id in callback function
body: <p>I have two associated models, employee and doctor:</p>
  
  <pre><code>class Employee &lt; ActiveRecord::Base
    has_one :doctor, :dependent =&gt; :destroy
    ...
  end
  
  class Doctor &lt; ActiveRecord::Base
    belongs_to :employee
  end
  </code></pre>
  
  <p>When the doctor has already been created and saved.<br>
  I want to get access to doctors id in employees after_save callback:</p>
  
  <pre><code>class Employee &lt; ActiveRecord::Base
    ...
    after_save :save_picture
    ...
    private
    def save_picture
      if doctor
        file_name = 'doctor_' + doctor.id.to_s + '.jpg'
        ...
      end
    end
  end
  </code></pre>
  
  <p>I can get access to any doctors method and any of them works fine, but "id" - it returns "nil".<br>
  What am I doing wrong?</p>