foreman/app/models/model.rb @ 5f6b2196
6e50fa1d | Ohad Levy | class Model < ActiveRecord::Base
|
|
has_many :hosts
|
|||
88693384 | Lucas Tolchinsky | before_destroy Ensure_not_used_by.new(:hosts)
|
|
6e50fa1d | Ohad Levy | validates_uniqueness_of :name
|
|
validates_presence_of :name
|
|||
b09b4515 | Ohad Levy | default_scope :order => 'name'
|
|
6e50fa1d | Ohad Levy | ||
def to_label
|
|||
name
|
|||
end
|
|||
5f6b2196 | Paul Kelly | alias_method :to_s, :to_label
|
|
6e50fa1d | Ohad Levy | end
|