Revision 08d4fc31
Added by Ori Rabin over 8 years ago
app/models/smart_proxy.rb | ||
---|---|---|
|
||
attr_accessible :name, :url, :location_ids, :organization_ids
|
||
validates_lengths_from_database
|
||
before_destroy EnsureNotUsedBy.new(:hosts, :hostgroups, :subnets, :domains, :puppet_ca_hosts, :puppet_ca_hostgroups, :realms)
|
||
before_destroy EnsureNotUsedBy.new(:hosts, :hostgroups, :subnets, :domains, [:puppet_ca_hosts, :hosts], [:puppet_ca_hostgroups, :hostgroups], :realms)
|
||
#TODO check if there is a way to look into the tftp_id too
|
||
# maybe with a predefined sql
|
||
has_and_belongs_to_many :features
|
Also available in: Unified diff
Fixes #11188 - EnsureNotUsedBy checks for unscoped associations before destroying