Project

General

Profile

Download (448 Bytes) Statistics
| Branch: | Tag: | Revision:
class Architecture < ActiveRecord::Base
include Authorization
has_many :hosts
has_and_belongs_to_many :operatingsystems
validates_uniqueness_of :name
before_destroy Ensure_not_used_by.new(:hosts)
validates_format_of :name, :with => /\A(\S+)\Z/, :message => "can't be blank or contain white spaces."
acts_as_audited

def to_param
name
end

def as_json(options={})
super({:only => [:name, :id]}.merge(options))
end

end
(1-1/54)