Project

General

Profile

Download (629 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman-docker / app / models / docker_container_wizard_states / exposed_port.rb @ 2b80fdd9

1
module DockerContainerWizardStates
2
  class ExposedPort < DockerParameter
3
    belongs_to :environment,  :foreign_key => :reference_id, :inverse_of => :exposed_ports,
4
                              :class_name => 'DockerContainerWizardStates::Environment'
5
    validates :key,  :uniqueness => { :scope => :reference_id },
6
                      :numericality => { :only_integer => true,
7
                                         :greater_than => 0,
8
                                         :less_than_or_equal_to => 655_35 }
9
    validates :value, :presence => true,
10
                      :inclusion => { :in => %w(tcp udp) }
11
  end
12
end