Sha256: 9597ca984d7889c112e2f7091231258554b4d4cc247b2a2ce8eb6424bef4c64c
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
module ForemanSalt class SaltModule < ActiveRecord::Base include Taxonomix include Authorizable extend FriendlyId friendly_id :name before_destroy EnsureNotUsedBy.new(:hosts, :hostgroups) has_and_belongs_to_many :hosts, :class_name => '::Host::Managed', :join_table => 'hosts_salt_modules', :association_foreign_key => 'host_id' has_and_belongs_to_many :hostgroups, :class_name => '::Hostgroup', :join_table => 'hostgroups_salt_modules' validates :name, :uniqueness => true, :presence => true, :format => { :with => /\A(?:[\w\d]+\.{0,1})+[^\.]\z/, :message => N_('must be alphanumeric, can contain dots and must not contain spaces') } default_scope lambda { order('salt_modules.name') } scoped_search :on => :name, :complete_value => true scoped_search :in => :hostgroups, :on => :name, :complete_value => true, :rename => :hostgroup scoped_search :in => :hosts, :on => :name, :complete_value => true, :rename => :host end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
foreman_salt-2.0.2 | app/models/foreman_salt/salt_module.rb |
foreman_salt-2.0.1 | app/models/foreman_salt/salt_module.rb |
foreman_salt-2.0.0 | app/models/foreman_salt/salt_module.rb |