app/models/dance_studio.rb
# Checks if the email is not already used by a dancer
Checks if the email is not already used by a dancer
Checks if the email is not already used by a dancer
def email_not_taken
    Dancer.all.each do |dancer|
      errors.add(:email, 'is taken') if dancer.email.downcase == email.downcase
    end
  end
def email_not_taken Dancer . all . each do | dancer | errors . add ( :email , 'is taken' ) if dancer . email . downcase == email . downcase end end
Checks if the email is not already used by a dancer
Checks if the email is not already used by a dancer