Revision 2c3cd215
Added by Marek Hulán over 8 years ago
app/models/nic/bmc.rb | ||
---|---|---|
class BMC < Managed
|
||
PROVIDERS = %w(IPMI)
|
||
before_validation :ensure_physical
|
||
before_validation { |nic| nic.provider.upcase! }
|
||
before_validation { |nic| nic.provider.try(:upcase!) }
|
||
validates :provider, :presence => true, :inclusion => { :in => PROVIDERS }
|
||
validates :mac, :presence => true, :if => :managed?
|
||
validate :validate_bmc_proxy
|
Also available in: Unified diff
Fixes #11258 - validation handles blank provider
(cherry picked from commit 3b27c173467c3ab4b53e844913cfd559b78d44ac)