Merge pull request #1193 from ZmagoD/zd_SCI_2481_

fixes project validation message [fixes SCI-2481]
This commit is contained in:
Zmago Devetak 2018-06-08 14:40:27 +02:00 committed by GitHub
commit eff68aead8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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."