Sha256: 43eda88f70c3b3a7d401adee36d665b3cd7be6d3c705e88539d0fef427995fbf

Contents?: true

Size: 606 Bytes

Versions: 15

Compression:

Stored size: 606 Bytes

Contents

module ThecoreSettings
  module Mongoid
    extend ActiveSupport::Concern
    included do
      include ::Mongoid::Document
      include ::Mongoid::Timestamps::Short

      store_in collection: "thecore_settings"
      field :enabled, type: ::Mongoid::VERSION.to_i < 4 ? Boolean : ::Mongoid::Boolean, default: true
      field :kind, type: String, default: ThecoreSettings.types.first
      field :ns, type: String, default: 'main'
      field :key, type: String
      field :raw, type: String
      field :label, type: String
      index({ns: 1, key: 1}, {unique: true, sparse: true})
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
thecore_settings-3.0.8 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.7 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.9 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.6 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.5 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.4 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.3 lib/thecore_settings/mongoid.rb
thecore_settings-3.0.0 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.8 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.7 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.6 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.5 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.4 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.3 lib/thecore_settings/mongoid.rb
thecore_settings-2.0.2 lib/thecore_settings/mongoid.rb