add deploy env users validator
This commit is contained in:
parent
638bf26003
commit
2cc89a8ac1
14
devops-service/db/validators/deploy_env/users.rb
Normal file
14
devops-service/db/validators/deploy_env/users.rb
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module Validators
|
||||||
|
class DeployEnv::Users < Base
|
||||||
|
|
||||||
|
def valid?
|
||||||
|
mongo_users = DevopsService.mongo.users_names(@model.users)
|
||||||
|
@nonexistent_users = @model.users - mongo_users
|
||||||
|
@nonexistent_users.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
def message
|
||||||
|
"These users are missing in mongo: '#{@nonexistent_users.join("', '")}'."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue
Block a user