Sha256: 1565f0089f997f35000bda31d7d662054bc36f319cdfec4dfab1a4211b4353ba

Contents?: true

Size: 324 Bytes

Versions: 35

Compression:

Stored size: 324 Bytes

Contents

class SocialAccount < ActiveRecord::Base
  include ActiveUUID::UUID

  belongs_to :user

  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

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
iugusdk-1.0.11 app/models/social_account.rb
iugusdk-1.0.10 app/models/social_account.rb
iugusdk-1.0.9 app/models/social_account.rb
iugusdk-1.0.8 app/models/social_account.rb
iugusdk-1.0.7 app/models/social_account.rb
iugusdk-1.0.6 app/models/social_account.rb
iugusdk-1.0.5 app/models/social_account.rb
iugusdk-1.0.4 app/models/social_account.rb
iugusdk-1.0.3 app/models/social_account.rb
iugusdk-1.0.2 app/models/social_account.rb
iugusdk-1.0.1 app/models/social_account.rb
iugusdk-1.0.0.alpha.32 app/models/social_account.rb
iugusdk-1.0.0.alpha.31 app/models/social_account.rb
iugusdk-1.0.0.alpha.30 app/models/social_account.rb
iugusdk-1.0.0.alpha.29 app/models/social_account.rb
iugusdk-1.0.0.alpha.28 app/models/social_account.rb
iugusdk-1.0.0.alpha.27 app/models/social_account.rb
iugusdk-1.0.0.alpha.26 app/models/social_account.rb
iugusdk-1.0.0.alpha.25 app/models/social_account.rb
iugusdk-1.0.0.alpha.24 app/models/social_account.rb