Sha256: b4d9d7ba65b567e95128552b6787af04103924c6d55332d1688b88dc84ada445
Contents?: true
Size: 930 Bytes
Versions: 6
Compression:
Stored size: 930 Bytes
Contents
class WcoHosting::Appliance include Mongoid::Document include Mongoid::Timestamps store_in collection: 'wco_appliances' belongs_to :leadset, class_name: 'Wco::Leadset', inverse_of: :appliances field :service_name before_validation :set_service_name, on: :create, unless: ->{ service_name } def set_service_name self[:service_name] = host.gsub(".", "_") end field :environment field :subdomain field :domain def host "#{subdomain}.#{domain}" end def route53_zone WcoHosting::Domain.find_by( name: domain ).route53_zone end belongs_to :appliance_tmpl, class_name: 'WcoHosting::ApplianceTmpl' def tmpl appliance_tmpl end def kind tmpl.kind end belongs_to :serverhost, class_name: 'WcoHosting::Serverhost' field :port STATE_PENDING = 'state-pending' STATE_LIVE = 'state-live' STATE_TERM = 'state-term' field :state, default: STATE_PENDING end
Version data entries
6 entries across 6 versions & 1 rubygems