app/models/devise_token_auth/concerns/user.rb
# only validate unique email among users that registered by email
only validate unique email among users that registered by email
only validate unique email among users that registered by email
def unique_email_user
    if provider == 'email' and self.class.where(provider: 'email', email: email).count > 0
      errors.add(:email, "This email address is already in use")
    end
  end
def unique_email_user if provider == 'email' and self . class . where ( provider : 'email' , email : email ) . count > 0 errors . add ( :email , "This email address is already in use" ) end end
only validate unique email among users that registered by email
only validate unique email among users that registered by email