Skip to content

Commit

Permalink
Merge pull request #21 from deiga/hotfix/mongoid-version-check
Browse files Browse the repository at this point in the history
Moved placement of mongoid version check
  • Loading branch information
skyeagle committed Feb 24, 2014
2 parents 843bc95 + f568ff5 commit 11a974a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions lib/mongoid-ancestry.rb
@@ -1,4 +1,11 @@
module Mongoid
def self.mongoid3?
::Mongoid.const_defined? :Observer # deprecated in Mongoid 4.x
end

def self.mongoid2?
::Mongoid.const_defined? :Contexts # deprecated in Mongoid 3.x
end
module Ancestry
extend ActiveSupport::Concern

Expand Down
6 changes: 0 additions & 6 deletions lib/mongoid-ancestry/version.rb
@@ -1,12 +1,6 @@
module Mongoid

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

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

module Ancestry
VERSION = '0.4.0'
Expand Down

0 comments on commit 11a974a

Please sign in to comment.