Project

General

Profile

« Previous | Next » 

Revision ad824a4d

Added by Ohad Levy almost 12 years ago

  • ID ad824a4d58edc10448801d00e18a11c60142fcb7

ensure that you can't delete a compute resource while its used - fixes #1683

View differences:

app/models/compute_resource.rb
# to STI avoid namespace issues when loading the class, we append Foreman::Model in our database type column
STI_PREFIX= "Foreman::Model"
before_destroy EnsureNotUsedBy.new(:hosts)
include Authorization
has_and_belongs_to_many :users, :join_table => "user_compute_resources"
validates_format_of :name, :with => /\A(\S+)\Z/, :message => "can't be blank or contain white spaces."

Also available in: Unified diff