From 0252300ebd9a1a68e7725be1687626daecfa9196 Mon Sep 17 00:00:00 2001 From: ponyesteves Date: Sat, 24 Oct 2015 14:29:08 -0300 Subject: [PATCH] change default message for already in use error and added to english and spanish translation files (en.yml and es.yml) --- app/models/devise_token_auth/concerns/user.rb | 2 +- config/locales/en.yml | 4 +++- config/locales/es.yml | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/devise_token_auth/concerns/user.rb b/app/models/devise_token_auth/concerns/user.rb index 379e225ba..4ec8053be 100644 --- a/app/models/devise_token_auth/concerns/user.rb +++ b/app/models/devise_token_auth/concerns/user.rb @@ -233,7 +233,7 @@ def token_validation_response # 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, :already_in_use, default: "address is already in use") + errors.add(:email, :already_in_use) end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 93434a352..ca035b555 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -27,4 +27,6 @@ en: errors: validate_sign_up_params: "Please submit proper sign up data in request body." validate_account_update_params: "Please submit proper account update data in request body." - not_email: "is not an email" \ No newline at end of file + not_email: "is not an email" + message: + already_in_use: already in use \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 9c81f9fd2..018fb6143 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -27,4 +27,6 @@ es: errors: validate_sign_up_params: "Los datos introducidos en la solicitud de acceso no son válidos." validate_account_update_params: "Los datos introducidos en la solicitud de actualización no son válidos." - not_email: "no es un correo electrónico" \ No newline at end of file + not_email: "no es un correo electrónico" + messages: + already_in_use: ya ha sido ocupado \ No newline at end of file