 b70165c3b4
			
		
	
	
		b70165c3b4
		
	
	
	
	
		
			
			fixed role name new field validators without validate fields types fixed error with user parser todo: project tests returned some tests, users fixed some more tests: filters images tests network tests keys tests test generator fixed run_list validator
		
			
				
	
	
		
			23 lines
		
	
	
		
			423 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			423 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require "commands/image"
 | |
| require_relative "base"
 | |
| 
 | |
| module Validators
 | |
|   module FieldValidator
 | |
|     class Image < Base
 | |
|       include ::ImageCommands
 | |
| 
 | |
|       def valid?
 | |
|         images = get_available_provider_images(::Devops::Db.connector, @model.provider)
 | |
|         images.detect do |image|
 | |
|           image["id"] == @value
 | |
|         end
 | |
|       end
 | |
| 
 | |
|       def message
 | |
|         "Invalid image '#{@value}'."
 | |
|       end
 | |
|     end
 | |
|   end
 | |
| end
 | |
| 
 |