class Current < ActiveSupport::CurrentAttributes
  attribute :account, :user

  resets { Time.zone = nil }

  def user=(user)
    super
    # overwritten later by the active account from session
    self.account = user.primary_account
    Time.zone = user.time_zone
  end

  def account=(account)
    super
  end
end
