Sha256: 2fd3d458879ee8a2284cad9bd3779e5aebcdbac115b08b21c25ae73baad4a0d8

Contents?: true

Size: 929 Bytes

Versions: 14

Compression:

Stored size: 929 Bytes

Contents

class Wco::ApplianceTmpl
  include Mongoid::Document
  include Mongoid::Timestamps

  field :kind
  validates :kind, uniqueness: { scope: :version }, presence: true

  field :version, type: :string, default: '0.0.0'
  validates :version, uniqueness: { scope: :kind }, presence: true
  index({ kind: -1, version: -1 }, { name: :kind_version })

  field :descr, type: :string

  field :image
  validates :image, presence: true

  field :volume_zip
  validates :volume_zip, presence: true

  KIND_CORPHOME1  = 'corphome1'
  KIND_DRUPAL     = 'drupal'
  KIND_HELLOWORLD = 'helloworld'
  # KINDS = [ 'smt', 'emailcrm', KIND_CORPHOME1, KIND_HELLOWORLD, KIND_DRUPAL,
  #   'mautic', 'matomo',
  #   'irowor', 'eCommerce' ]
  KINDS = [ KIND_HELLOWORLD ]

  has_many :appliances, class_name: 'Wco::Appliance'

  def self.latest_of kind
    where({ kind: kind }).order_by({ version: :desc }).first
  end

end
AppTmpl = Wco::ApplianceTmpl

Version data entries

14 entries across 14 versions & 1 rubygems

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