foreman/app/models/architecture.rb @ d995ecb4
a393106d | Ohad Levy | class Architecture < ActiveRecord::Base
|
|
has_many :hosts
|
|||
e6d73c7f | Ohad Levy | has_and_belongs_to_many :operatingsystems
|
|
a393106d | Ohad Levy | validates_uniqueness_of :name
|
|
1e4b330b | Lucas Tolchinsky | before_destroy Ensure_not_used_by.new(:hosts)
|
|
1e6a9256 | Lucas Tolchinsky | validates_format_of :name, :with => /\A(\S+)\Z/, :message => "can't be blank or contain white spaces."
|
|
611397af | Ohad Levy | acts_as_audited
|
|
a393106d | Ohad Levy | ||
def to_s
|
|||
name
|
|||
3de556e1 | Lucas Tolchinsky | end
|
|
d995ecb4 | Paul Kelly | ||
def self.per_page
|
|||
25
|
|||
end
|
|||
a393106d | Ohad Levy | end
|