Sha256: 3bd644bdf75a539ef2b4d07a2f9c8e6800baeb63124b1cf2cc0ed0ce486725b3
Contents?: true
Size: 297 Bytes
Versions: 6
Compression:
Stored size: 297 Bytes
Contents
class SocialAccount < ActiveRecord::Base 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
6 entries across 6 versions & 1 rubygems