14 lines
242 B
Ruby
14 lines
242 B
Ruby
class Server < ActiveRecord::Base
|
|
belongs_to :operating_system
|
|
before_create :generate_hash
|
|
has_many :configuration_files
|
|
|
|
def generate_hash
|
|
self.namehash = SecureRandom.hex
|
|
end
|
|
|
|
def to_s
|
|
"#{name} - #{namehash}"
|
|
end
|
|
end
|