fluke/devops-service/db/validators/deploy_env/image.rb
2016-01-20 18:47:07 +04:00

19 lines
383 B
Ruby

require "commands/image"
module Validators
class DeployEnv::Image < Base
include ::ImageCommands
def valid?
return true unless @model.image
get_available_provider_images(::Devops::Db.connector, @model.provider).detect do |image|
image["id"] == @model.image
end
end
def message
"Invalid image '#{@model.image}'."
end
end
end