1
|
module DockerContainerWizardStates
|
2
|
class Environment < ActiveRecord::Base
|
3
|
self.table_name_prefix = 'docker_container_wizard_states_'
|
4
|
belongs_to :wizard_state, :class_name => DockerContainerWizardState
|
5
|
|
6
|
has_many :environment_variables, :dependent => :destroy, :foreign_key => :reference_id,
|
7
|
:inverse_of => :environment,
|
8
|
:class_name =>
|
9
|
'DockerContainerWizardStates::EnvironmentVariable'
|
10
|
|
11
|
has_many :exposed_ports, :dependent => :destroy, :foreign_key => :reference_id,
|
12
|
:inverse_of => :environment,
|
13
|
:class_name => 'DockerContainerWizardStates::ExposedPort'
|
14
|
has_many :dns, :dependent => :destroy, :foreign_key => :reference_id,
|
15
|
:inverse_of => :environment,
|
16
|
:class_name => 'DockerContainerWizardStates::Dns'
|
17
|
|
18
|
include ForemanDocker::ParameterValidators
|
19
|
accepts_nested_attributes_for :environment_variables, :allow_destroy => true
|
20
|
accepts_nested_attributes_for :exposed_ports, :allow_destroy => true
|
21
|
accepts_nested_attributes_for :dns, :allow_destroy => true
|
22
|
|
23
|
end
|
24
|
end
|