| 
									
										
										
										
											2015-08-13 15:49:37 +03:00
										 |  |  | module Validators | 
					
						
							|  |  |  |   class DeployEnv::StackTemplate < Base | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def valid? | 
					
						
							| 
									
										
										
										
											2015-11-03 11:46:54 +03:00
										 |  |  |       return true unless @model.stack_template | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-20 17:47:07 +03:00
										 |  |  |       Devops::Db.connector.stack_templates.detect do |template| | 
					
						
							|  |  |  |         template.id == @model.stack_template | 
					
						
							| 
									
										
										
										
											2015-08-13 15:49:37 +03:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def message | 
					
						
							|  |  |  |       "Invalid stack template '#{@model.stack_template}'." | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |