lib/generators/happy_seed/omniauth/templates/user.rb in happy_seed-0.0.1 vs lib/generators/happy_seed/omniauth/templates/user.rb in happy_seed-0.0.2
- old
+ new
@@ -1,9 +1,11 @@
TEMP_EMAIL_PREFIX = 'change@me'
TEMP_EMAIL_REGEX = /\Achange@me/
+ has_many :identities
+
# validates_format_of :email, :without => TEMP_EMAIL_REGEX, on: :update
def self.find_for_oauth(auth, signed_in_resource = nil)
# Get the identity and user if they exist
@@ -31,10 +33,10 @@
name: auth.extra.raw_info.name,
#username: auth.info.nickname || auth.uid,
email: email ? email : "#{TEMP_EMAIL_PREFIX}-#{auth.uid}-#{auth.provider}.com",
password: Devise.friendly_token[0,20]
)
- user.skip_confirmation!
+ # user.skip_confirmation!
user.save!
end
end
# Associate the identity with the user if needed