21 lines
		
	
	
		
			444 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			444 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
|   | require "commands/bootstrap_templates" | ||
|  | module Validators | ||
|  |   class Image::BootstrapTemplate < Base | ||
|  | 
 | ||
|  |     include BootstrapTemplatesCommands | ||
|  | 
 | ||
|  |     def valid? | ||
|  |       if @model.bootstrap_template | ||
|  |         templates = get_templates | ||
|  |         templates.include?(@model.bootstrap_template) | ||
|  |       else | ||
|  |         true | ||
|  |       end | ||
|  |     end | ||
|  | 
 | ||
|  |     def message | ||
|  |       "Invalid bootstrap template '#{@model.bootstrap_template}' for image '#{@model.id}'" | ||
|  |     end | ||
|  |   end | ||
|  | end |