Bug #2246 ยป 0001-fixes-2246-deleting-an-environment-also-deletes-asso.patch
app/models/environment.rb | ||
---|---|---|
validates_presence_of :name
|
||
validates_uniqueness_of :name
|
||
validates_format_of :name, :with => /^[\w\d]+$/, :message => "is alphanumeric and cannot contain spaces"
|
||
has_many :config_templates, :through => :template_combinations, :dependent => :destroy
|
||
has_many :template_combinations
|
||
has_many :config_templates, :through => :template_combinations
|
||
has_many :template_combinations, :dependent => :destroy
|
||
before_destroy EnsureNotUsedBy.new(:hosts)
|
||