Skip to content

Commit

Permalink
Use a method compatible with mongoid-observers to determinine the ver…
Browse files Browse the repository at this point in the history
…sion of Mongoid.
  • Loading branch information
zeitnot authored and dblock committed Dec 9, 2014
1 parent 0c6aa47 commit 7ab06f4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.4.5 (Next)
------------

* [#123](https://github.com/aq1018/mongoid-history/pull/123): Use a method compatible with mongoid-observers to determinine the version of Mongoid - [@zeitnot](https://github.com/zeitnot).
* Your contribution here.

0.4.4 (7/29/2014)
Expand Down
1 change: 1 addition & 0 deletions lib/mongoid-history.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'easy_diff'
require 'versionomy'

require 'mongoid/history'
require 'mongoid/history/version'
Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/history/mongoid.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Mongoid
module History
def self.mongoid3?
::Mongoid.const_defined? :Observer # deprecated in Mongoid 4.x
Versionomy.parse(::Mongoid::VERSION).major == 3
end
end
end
1 change: 1 addition & 0 deletions mongoid-history.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'easy_diff'
s.add_runtime_dependency 'mongoid', '>= 3.0'
s.add_runtime_dependency 'activesupport'
s.add_runtime_dependency 'versionomy'

s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '~> 3.1'
Expand Down

0 comments on commit 7ab06f4

Please sign in to comment.