Sha256: 2cb95e6b013ca9c16dbf6aea1a1dc8a8edec940371fe36499120ada20bac3ad7

Contents?: true

Size: 500 Bytes

Versions: 11

Compression:

Stored size: 500 Bytes

Contents

require 'tengine/core'

class Tengine::Core::Setting
  include Mongoid::Document
  include Tengine::Core::FindByName

  field :name, :type => String
  field :value

  validates :name, :presence => true, :uniqueness => true

  index :name, :unique => true

  class << self
    def dsl_version
      document = first(:conditions => {:name => "dsl_version"})
      raise Mongoid::Errors::DocumentNotFound.new(Tengine::Core::Setting, "dsl_version") unless document
      document.value
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tengine_core-0.5.39 lib/tengine/core/setting.rb
tengine_core-0.5.38 lib/tengine/core/setting.rb
tengine_core-0.5.37 lib/tengine/core/setting.rb
tengine_core-0.5.36 lib/tengine/core/setting.rb
tengine_core-0.5.35 lib/tengine/core/setting.rb
tengine_core-0.5.34 lib/tengine/core/setting.rb
tengine_core-0.5.33 lib/tengine/core/setting.rb
tengine_core-0.5.32 lib/tengine/core/setting.rb
tengine_core-0.5.31 lib/tengine/core/setting.rb
tengine_core-0.5.30 lib/tengine/core/setting.rb
tengine_core-0.5.28 lib/tengine/core/setting.rb