<NME> user.rb
<BEF> class User < ActiveRecord::Base
  has_many :agreements
  has_many :signatures

  def self.find_or_create_for_github_oauth(oauth)
    attributes_to_update = [:name, :nickname, :oauth_token, :email]

    self.find_or_create_by_uid(oauth[:uid]).tap do |user|
      oauth.slice(*attributes_to_update).each do |key, value|
        user.send("#{key}=", value)
      end
      Rails.logger.info "Updated oauth token for #{user.email}"
      user.save
    end
  end

  def self.find_by_email_or_nickname(email, nickname)
    self.where("email = ? OR nickname = ?", email, nickname).first
  end
end

<MSG> Update logging to include user id

Since some users do not have e-mails we need the user id in order to identify what user is having their oauth token updated in logging.

<DFF> @@ -9,7 +9,7 @@ class User < ActiveRecord::Base
       oauth.slice(*attributes_to_update).each do |key, value|
         user.send("#{key}=", value)
       end
-      Rails.logger.info "Updated oauth token for #{user.email}"
+      Rails.logger.info "Updated oauth token for #{user.id} : #{user.email}"
       user.save
     end
   end

Update logging to include user id