| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  | require "commands/bootstrap_templates" | 
					
						
							| 
									
										
										
										
											2015-07-16 12:54:16 +03:00
										 |  |  | require "db/validators/base" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  | module Validators | 
					
						
							| 
									
										
										
										
											2015-07-16 12:54:16 +03:00
										 |  |  |   module Image | 
					
						
							|  |  |  |     class BootstrapTemplate < Base | 
					
						
							| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-16 12:54:16 +03:00
										 |  |  |       include BootstrapTemplatesCommands | 
					
						
							| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-16 12:54:16 +03:00
										 |  |  |       def valid? | 
					
						
							| 
									
										
										
										
											2016-01-21 02:26:27 +03:00
										 |  |  |         get_templates.include?(@model.bootstrap_template) | 
					
						
							| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-16 12:54:16 +03:00
										 |  |  |       def message | 
					
						
							|  |  |  |         "Invalid bootstrap template '#{@model.bootstrap_template}' for image '#{@model.id}'" | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2015-02-12 13:01:05 +03:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |