title: Callback during sign- in process in order to change boolean to true or false
body: <p>I'm using the devise gem with my app. Which callback should I use in order to pass a method from my user model during the sign in process??</p>
  
  <p><code>Warden::Manager.after_set_user ?
  before_validation?
  before_save?
  before_create?</code></p>
  
  <p>Method details: 
  I have a boolean column:is_active in the users table.
  Each time a user tries to sign in, the braintree code finds if the user has has an active or not subscription thru the braintree api. And if the user has and active or not subscription I'm trying to update the is_active column to true or false.</p>
  
  <p>I'm using this currently, but it's not working:</p>
  
  <pre><code>Warden::Manager.after_set_user :scope =&gt; :user do |user, auth, opts|
  
    customer = Braintree::Customer.find('customer_id')
    customer_card = customer.payment_methods[0].token
    payment_method = Braintree::PaymentMethod.find(customer_card)
    sub = payment_method.subscriptions[0]
    sub.status
  
  if Braintree::Subscription::Status::Active
    obj = User.find_by_id(params[:id])
    obj.is_active = true
    obj.save!
  
  else
    obj = User.find_by_id(params[:id])
    obj.is_active = false
    obj.save!
   end
  end
  
  def active_for_authentication?
    super &amp;&amp; is_active?
  end
  
  def inactive_message
    "User not active, please subscribe!"
  end
  </code></pre>