Sha256: c41ab5baf7235e920a5577a2bf68fdb348baef0f134fa66e07c34ed0258b218a

Contents?: true

Size: 995 Bytes

Versions: 9

Compression:

Stored size: 995 Bytes

Contents

module DockerContainerWizardStates
  class ExposedPort < Parameter
    # The Parameter class from which ExposedPort class inherits,validates for the
    # presence of an  associated domain, operating system, host or host group. We
    # will have to reset those validations for the  ExposedPort class as  they do
    # not make any sense for the context in which this class is being used here.
    ExposedPort.reset_callbacks(:validate)

    belongs_to :environment,  :foreign_key => :reference_id, :inverse_of => :exposed_ports,
                              :class_name => 'DockerContainerWizardStates::Environment'
    validates :name,  :uniqueness => { :scope => :reference_id },
                      :numericality => { :only_integer => true,
                                         :greater_than => 0,
                                         :less_than_or_equal_to => 655_35 }
    validates :value, :presence => true,
                      :inclusion => { :in => %w(tcp udp) }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_docker-3.0.0 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-2.1.1 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-2.1.0 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-2.0.1 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-2.0.0 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-1.4.1 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-1.4.0 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-1.3.1 app/models/docker_container_wizard_states/exposed_port.rb
foreman_docker-1.3.0 app/models/docker_container_wizard_states/exposed_port.rb