fixes project validation message [fixes SCI-2481]

This commit is contained in:
zmagod 2018-06-07 16:42:11 +02:00
parent 1bc869d4ca
commit 11ebea573a
2 changed files with 8 additions and 3 deletions

View file

@ -7,8 +7,7 @@ class Project < ApplicationRecord
validates :name,
length: { minimum: Constants::NAME_MIN_LENGTH,
maximum: Constants::NAME_MAX_LENGTH },
uniqueness: { scope: :team, case_sensitive: false,
message: I18n.t('projects.create.name_taken') }
uniqueness: { scope: :team, case_sensitive: false }
validates :visibility, presence: true
validates :team, presence: true

View file

@ -52,6 +52,13 @@ en:
email_already_taken: "SciNote account with email %{email} alreday exists"
failed_to_save: "Failed to create new user"
activerecord:
errors:
models:
project:
attributes:
name:
taken: "This project name has to be unique inside a team (this includes the archive)."
helpers:
label:
team:
@ -268,7 +275,6 @@ en:
contact_admins: "To invite additional users to team %{team}, contact its administrator/s."
create:
success_flash: "Project <strong>%{name}</strong> successfully created."
name_taken: "This project name has to be unique inside a team (this includes the archive)."
update:
success_flash: "Project <strong>%{name}</strong> successfully updated."
error_flash: "Project <strong>%{name}</strong> not updated."