Revision 2b80fdd9
Added by Ori Rabin almost 6 years ago
app/models/exposed_port.rb | ||
---|---|---|
1 |
class ExposedPort < Parameter |
|
2 |
# The Parameter class from which ExposedPort class inherits,validates for the |
|
3 |
# presence of an associated domain, operating system, host or host group. We |
|
4 |
# will have to reset those validations for the ExposedPort class as they do |
|
5 |
# not make any sense for the context in which this class is being used here. |
|
6 |
ExposedPort.reset_callbacks(:validate) |
|
7 |
|
|
1 |
class ExposedPort < DockerParameter |
|
8 | 2 |
belongs_to :container, :foreign_key => :reference_id, :inverse_of => :exposed_ports |
9 |
audited :except => [:priority], :associated_with => :container, :allow_mass_assignment => true
|
|
10 |
validates :name, :uniqueness => { :scope => :reference_id }
|
|
11 |
validates :name, :numericality => { :only_integer => true,
|
|
3 |
audited :associated_with => :container, :allow_mass_assignment => true |
|
4 |
validates :key, :uniqueness => { :scope => :reference_id }
|
|
5 |
validates :key, :numericality => { :only_integer => true,
|
|
12 | 6 |
:greater_than => 0, |
13 | 7 |
:less_than_or_equal_to => 655_35, |
14 | 8 |
:message => "%{value} is not a valid port number" } |
Also available in: Unified diff
Fixes #13043 - Change Parameter inheritance to DockerParameter