title: passing current_user to model via callback
body: <p>I have a couple of callbacks that log activity on create/update:</p>
  
  <pre><code>class Projelement
    ..
    after_create   { |p| p.log_projelement_activity "created" }
    after_update   { |p| p.log_projelement_activity "edited"  }
  </code></pre>
  
  <p>I need to augment the design to pass the <code>current_user</code> (Devise) to <code>log_projelement_activity</code> to record the user at the time of create/update. </p>
  
  <p>I'm trying to pass the <code>current_user</code> from the controller to the model and the callbacks via a virtual attribute. But this isn't working.</p>
  
  <p>The code:</p>
  
  <pre><code>class Projelement
    attr_accessor :modifying_user
  
    after_create   { |p| p.log_projelement_activity "created", modifying_user }
    after_update   { |p| p.log_projelement_activity "edited",  modifying_user }
  
    def log_projelement_activity(op_type, user)
      @a = Activity.new
      @a.user = user
    end
  end
  
  
  class MilestoneController
    ..
    def create
      @milestone = Milestone.new(params[:milestone])
      @milestone.modifying_user = current_user
    end
  end
  </code></pre>
  
  <p>Each create/update <code>Activity</code> has expected values, except that the <code>user</code> field is <code>nil</code>. </p>
  
  <p>What am I missing?</p>