| 
									
										
										
										
											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 | 
					
						
							|  |  |  |       "These users are missing in mongo: '#{@nonexistent_users.join("', '")}'." | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2015-02-18 11:00:24 +03:00
										 |  |  | end |