Sha256: c421f620f777df5faf6699547216d07a36beb8772a527e83feb5649d5f7acc68

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  module Orderable
    MUTEX = Mutex.new

    class << self
      def configure
        yield(config) if block_given?
      end

      def config
        @config || MUTEX.synchronize { @config = ::Mongoid::Orderable::Configs::GlobalConfig.new }
      end
    end

    extend ActiveSupport::Concern

    included do
      class_attribute :orderable_configs
    end

    class_methods do
      def orderable(options = {})
        Mongoid::Orderable::Installer.new(self, options).setup
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongoid_orderable-6.0.5 lib/mongoid/orderable.rb
mongoid_orderable-6.0.4 lib/mongoid/orderable.rb
mongoid_orderable-6.0.3 lib/mongoid/orderable.rb
mongoid_orderable-6.0.2 lib/mongoid/orderable.rb
mongoid_orderable-6.0.1 lib/mongoid/orderable.rb
mongoid_orderable-6.0.0 lib/mongoid/orderable.rb