Project

General

Profile

« Previous | Next » 

Revision f6c83c4d

Added by Marek Hulán almost 8 years ago

Fixes #15238 - ignore empty NIC identifiers

(cherry picked from commit 7e20cbac5951b858716268cce29f0fad16b71081)

View differences:

app/models/nic/base.rb
validates :host, :presence => true, :if => Proc.new { |nic| nic.require_host? }
validates :identifier, :uniqueness => { :scope => :host_id },
:if => ->(nic) { nic.identifier && nic.host },
:unless => ->(nic) { nic.identifier_was.present? }
:if => ->(nic) { nic.identifier.present? && nic.host && !nic.identifier_was.present? }
validate :exclusive_primary_interface
validate :exclusive_provision_interface

Also available in: Unified diff