continue to backport old code
This commit is contained in:
@@ -8,6 +8,10 @@ class User < ApplicationRecord
|
||||
devise :rememberable, :omniauthable, omniauth_providers: [:bnet]
|
||||
|
||||
has_many :wow_characters, dependent: :destroy
|
||||
has_many :user_obtain_wow_mounts, dependent: :destroy
|
||||
has_many :wow_mounts, through: :user_obtain_wow_mounts
|
||||
has_many :user_obtain_wow_pets, dependent: :destroy
|
||||
has_many :wow_pets, through: :user_obtain_wow_pets
|
||||
|
||||
validates :battletag, presence: true, uniqueness: true
|
||||
|
||||
@@ -28,8 +32,8 @@ class User < ApplicationRecord
|
||||
|
||||
def self.new_with_session(params, session)
|
||||
super.tap do |user|
|
||||
if (data = session['devise.bnet_data']) && session['devise.bnet_data']['extra']['raw_info']
|
||||
user.email = data['email'] if user.email.blank?
|
||||
if (data = session['devise.bnet_data']) && session['devise.bnet_data']['extra']['raw_info'] && user.email.blank?
|
||||
user.email = data['email']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user