27 lines
460 B
Ruby
27 lines
460 B
Ruby
# encoding: utf-8
|
|
|
|
class Machine < ActiveRecord::Base
|
|
# attr_accessible :title, :body
|
|
|
|
# validates :title, :presence => true
|
|
# validates :body, :presence => true
|
|
|
|
has_many :services
|
|
belongs_to :local_network
|
|
|
|
# scope :published, -> { order("created_at DESC") }
|
|
|
|
# def tailscale_ip
|
|
# tailscale_ip
|
|
# end
|
|
|
|
def local_domain
|
|
"#{domain}.#{local_network.tld}"
|
|
end
|
|
|
|
def local_ip
|
|
"#{local_network.subnet}.#{local_ip_octet}"
|
|
end
|
|
|
|
end
|