Sha256: 80adec87f6863e3159f7fe4a0b8e40e0bfe835692c272d90386537d37bb2c51b
Contents?: true
Size: 1.03 KB
Versions: 3
Compression:
Stored size: 1.03 KB
Contents
class DiscoveryRule < ActiveRecord::Base include Authorizable extend FriendlyId friendly_id :name include Parameterizable::ByIdName attr_accessible :name, :enabled, :hostgroup_id, :hostname, :max_count, :priority, :search validates :name, :presence => true, :uniqueness => true, :format => { :with => /\A(\S+)\Z/, :message => N_("can't contain white spaces.") } validates :search, :presence => true validates :hostname, :format => { :with => /\A[a-zA-Z<]/, :message => N_("must start with a letter or ERB.") }, :allow_blank => true validates :hostgroup_id, :presence => true validates :max_count, :numericality => { :only_integer => true, :greater_than_or_equal_to => 0 } validates :priority, :presence => true, :numericality => { :only_integer => true, :greater_than_or_equal_to => 0 } validates_lengths_from_database belongs_to :hostgroup has_many :hosts scoped_search :on => :name, :complete_value => :true scoped_search :on => :priority scoped_search :on => :search scoped_search :on => :enabled end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
foreman_discovery-3.0.0 | app/models/discovery_rule.rb |
foreman_discovery-2.0.0 | app/models/discovery_rule.rb |
foreman_discovery-2.0.0.rc2 | app/models/discovery_rule.rb |