Revision 6a6cccfe
Added by Dominic Cleal almost 10 years ago
app/models/compute_resource.rb | ||
---|---|---|
before_validation :set_attributes_hash
|
||
has_many :compute_attributes, :dependent => :destroy
|
||
has_many :compute_profiles, :through => :compute_attributes
|
||
# attribute used by *_names and *_name methods. default is :name
|
||
attr_name :to_label
|
||
|
||
# The DB may contain compute resource from disabled plugins - filter them out here
|
||
scope :live_descendants, lambda { where(:type => self.descendants.map(&:to_s)) unless Rails.env.development? }
|
Also available in: Unified diff
fixes #5679 - change CR identifier to name to fix has_many association lookup