Update failure message for UsersProject uniqueness validation
Was "User has already been taken", is now "User already exists in project".
This commit is contained in:
parent
a595f8944a
commit
bde19c061a
1 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,7 @@ class UsersProject < ActiveRecord::Base
|
||||||
after_save :update_repository
|
after_save :update_repository
|
||||||
after_destroy :update_repository
|
after_destroy :update_repository
|
||||||
|
|
||||||
validates_uniqueness_of :user_id, scope: [:project_id]
|
validates_uniqueness_of :user_id, scope: [:project_id], message: "already exists in project"
|
||||||
validates_presence_of :user_id
|
validates_presence_of :user_id
|
||||||
validates_presence_of :project_id
|
validates_presence_of :project_id
|
||||||
|
|
||||||
|
@ -48,10 +48,10 @@ class UsersProject < ActiveRecord::Base
|
||||||
|
|
||||||
def self.access_roles
|
def self.access_roles
|
||||||
{
|
{
|
||||||
"Guest" => GUEST,
|
"Guest" => GUEST,
|
||||||
"Reporter" => REPORTER,
|
"Reporter" => REPORTER,
|
||||||
"Developer" => DEVELOPER,
|
"Developer" => DEVELOPER,
|
||||||
"Master" => MASTER
|
"Master" => MASTER
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue