Project

General

Profile

Download (565 Bytes) Statistics
| Branch: | Tag: | Revision:
644f7f22 Ohad Levy
class HostgroupClass < ActiveRecord::Base
acfbc458 Marek Hulan
include Authorizable
ae4998bc Tomer Brisker
include CounterCacheFix
83683ed0 Tomer Brisker
include PuppetclassTotalHosts::JoinTable
ae4998bc Tomer Brisker
9c864cb6 Ohad Levy
audited :associated_with => :hostgroup, :allow_mass_assignment => true
644f7f22 Ohad Levy
belongs_to :hostgroup
6895854c Stephen Benjamin
belongs_to :puppetclass, :counter_cache => :hostgroups_count
644f7f22 Ohad Levy
feacea35 Amos Benari
attr_accessible :hostgroup_id, :hostgroup, :puppetclass_id, :puppetclass
f2c78d4a Joseph Magen
validates :hostgroup_id, :presence => true
validates :puppetclass_id, :presence => true, :uniqueness => {:scope => :hostgroup_id}
644f7f22 Ohad Levy
def name
"#{hostgroup} - #{puppetclass}"
end

end