Project

General

Profile

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

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

1
require 'resolv'
2

    
3
module DockerContainerWizardStates
4
  class Dns < DockerParameter
5
    belongs_to :environment,  :foreign_key => :reference_id,
6
                              :inverse_of => :dns,
7
                              :class_name => 'DockerContainerWizardStates::Environment'
8
    validates :key, :uniqueness => { :scope => :reference_id },
9
                     :format => {
10
                       :with => Regexp.union(Resolv::IPv4::Regex,
11
                                             Resolv::IPv6::Regex,
12
                                             /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}$/) }
13
  end
14
end