Project

General

Profile

Revision 2b80fdd9

Added by Ori Rabin almost 6 years ago

Fixes #13043 - Change Parameter inheritance to DockerParameter

View differences:

app/models/docker_container_wizard_states/dns.rb
1 1
require 'resolv'
2 2

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

  
4
  class Dns < DockerParameter
11 5
    belongs_to :environment,  :foreign_key => :reference_id,
12 6
                              :inverse_of => :dns,
13 7
                              :class_name => 'DockerContainerWizardStates::Environment'
14
    validates :name, :uniqueness => { :scope => :reference_id },
8
    validates :key, :uniqueness => { :scope => :reference_id },
15 9
                     :format => {
16 10
                       :with => Regexp.union(Resolv::IPv4::Regex,
17 11
                                             Resolv::IPv6::Regex,

Also available in: Unified diff