require "commands/bootstrap_templates"
require "db/validators/base"

module Validators
  module Image
    class BootstrapTemplate < Base

      include BootstrapTemplatesCommands

      def valid?
        get_templates.include?(@model.bootstrap_template)
      end

      def message
        "Invalid bootstrap template '#{@model.bootstrap_template}' for image '#{@model.id}'"
      end
    end
  end
end
