22 lines
		
	
	
		
			399 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			399 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require "commands/image"
 | |
| require_relative "base"
 | |
| 
 | |
| module Validators
 | |
|   module FieldValidator
 | |
|     class Image < Base
 | |
|       include ::ImageCommands
 | |
| 
 | |
|       def valid?
 | |
|         get_available_provider_images(::Devops::Db.connector, @model.provider).detect do |image|
 | |
|           image["id"] == @value
 | |
|         end
 | |
|       end
 | |
| 
 | |
|       def message
 | |
|         "Invalid image '#{@value}'."
 | |
|       end
 | |
|     end
 | |
|   end
 | |
| end
 | |
| 
 | 
