Module: Mongoid

Defined in:
lib/mongoid-ancestry.rb,
lib/mongoid-ancestry/version.rb,
lib/mongoid-ancestry/exceptions.rb,
lib/mongoid-ancestry/class_methods.rb,
lib/mongoid-ancestry/instance_methods.rb

Defined Under Namespace

Modules: Ancestry

Class Method Summary collapse

Class Method Details

.mongoid2?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/mongoid-ancestry.rb', line 6

def self.mongoid2?
  ::Mongoid.const_defined? :Contexts # deprecated in Mongoid 3.x
end

.mongoid3?Boolean

Returns:

  • (Boolean)

2
3
4
# File 'lib/mongoid-ancestry.rb', line 2

def self.mongoid3?
  ::Mongoid.const_defined? :Observer # deprecated in Mongoid 4.x
end