fluke/devops-service/db/validators/deploy_env/image.rb
2014-11-27 19:45:35 +04:00

18 lines
344 B
Ruby

require "commands/image"
module Validators
class DeployEnv::Image < Base
include ::ImageCommands
def valid?
images = get_images(DevopsService.mongo, @model.provider)
images.detect do |image|
image["id"] == @model.image
end
end
def message
"Invalid image '#{@model.image}'."
end
end
end