Project

General

Profile

« Previous | Next » 

Revision c832a24f

Added by Ohad Levy almost 12 years ago

  • ID c832a24f646c20a256b2dfff68f069ae28cb1769

dont enforce host domain validations on non managed hosts

View differences:

app/models/host.rb
validates_uniqueness_of :sp_mac, :allow_nil => true, :allow_blank => true
validates_uniqueness_of :sp_name, :sp_ip, :allow_blank => true, :allow_nil => true
validates_presence_of :architecture_id, :operatingsystem_id, :if => Proc.new {|host| host.managed}
validates_presence_of :domain_id
validates_presence_of :domain_id, :if => Proc.new {|host| host.managed}
validates_presence_of :mac, :unless => Proc.new { |host| host.hypervisor? or host.compute? or !host.managed }
validates_length_of :root_pass, :minimum => 8,:too_short => 'should be 8 characters or more'

Also available in: Unified diff