Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a method compatible with mongoid-observers to determinine the version of mongoid. #126

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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