Sha256: 41c09dcdc6e2a98e8e9867a0fc974167b8f16ad05a9471e7d7db5b4b6314f0ae

Contents?: true

Size: 787 Bytes

Versions: 14

Compression:

Stored size: 787 Bytes

Contents

class Wco::Appliance
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name
  validates :name, uniqueness: { scope: :leadset_id }, presence: true

  field :kind

  field :service_name
  field :environment

  field :subdomain
  field :domain
  def host
    "#{subdomain}.#{domain}"
  end

  field :leadset_id
  def leadset
    Leadset.find leadset_id
  end

  belongs_to :appliance_tmpl, class_name: 'Wco::ApplianceTmpl'
  def tmpl
    appliance_tmpl
  end

  belongs_to :serverhost,     class_name: 'Wco::Serverhost'
  belongs_to :wco_leadset, class_name: 'Wco::Leadset', inverse_of: :appliances

  # field :ip
  field :port

  STATE_PENDING = 'state-pending'
  STATE_LIVE    = 'state-live'
  STATE_TERM    = 'state-term'
  field :state, default: STATE_PENDING

end


Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ish_models-0.0.33.304 lib/wco/appliance.rb
ish_models-0.0.33.303 lib/wco/appliance.rb
ish_models-0.0.33.302 lib/wco/appliance.rb
ish_models-0.0.33.301 lib/wco/appliance.rb
ish_models-0.0.33.300 lib/wco/appliance.rb
ish_models-0.0.33.299 lib/wco/appliance.rb
ish_models-0.0.33.298 lib/wco/appliance.rb
ish_models-0.0.33.297 lib/wco/appliance.rb
ish_models-0.0.33.296 lib/wco/appliance.rb
ish_models-0.0.33.295 lib/wco/appliance.rb
ish_models-0.0.33.294 lib/wco/appliance.rb
ish_models-0.0.33.293 lib/wco/appliance.rb
ish_models-0.0.33.292 lib/wco/appliance.rb
ish_models-0.0.33.291 lib/wco/appliance.rb