2014-11-26 18:44:29 +03:00
|
|
|
module Validators
|
|
|
|
|
class DeployEnv::Users < Base
|
|
|
|
|
|
|
|
|
|
def valid?
|
2015-02-18 11:00:24 +03:00
|
|
|
mongo_users = ::Devops::Db.connector.users_names(@model.users)
|
2014-11-26 18:44:29 +03:00
|
|
|
@nonexistent_users = @model.users - mongo_users
|
|
|
|
|
@nonexistent_users.empty?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def message
|
2015-09-22 12:19:15 +03:00
|
|
|
Devops::Messages.t("project.deploy_env.validation.users.not_exist", users: @nonexistent_users.join("', '"))
|
2014-11-26 18:44:29 +03:00
|
|
|
end
|
|
|
|
|
end
|
2015-02-18 11:00:24 +03:00
|
|
|
end
|