Class: SocialAccount
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SocialAccount
show all
- Includes:
- ActiveUUID::UUID
- Defined in:
- app/models/social_account.rb
Instance Method Summary
collapse
#fix_uuid_strings, included
Instance Method Details
#unlink ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'app/models/social_account.rb', line 6
def unlink
if self.user.social_accounts.count == 1 && (self.user.email.blank? || self.user.encrypted_password.blank?)
errors.add(:base, "only_social_and_no_email")
false
else
self.destroy
end
end
|