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