Skip to content

Commit

Permalink
Compatibility with mongoid 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Oct 20, 2015
1 parent 44c03cf commit ea89fb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ services:

rvm:
- 1.9.3
- 2.1.2
- 2.1
- 2.2

env:
- MONGOID_VERSION=3
- MONGOID_VERSION=4
- MONGOID_VERSION=5
- MONGO_MAPPER_VERSION=0.13.1

language: ruby
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#### 1.2.1 (Next)

* [#11](https://github.com/derekharmel/sunspot_mongo/pull/11): Support for Mongoid 5 - [@dblock](https://github.com/dblock).
* Your contribution here.

#### 1.2.0 (2015/08/28)
Expand Down
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
source 'https://rubygems.org'

ENV['MONGOID_VERSION'] = '4' unless ENV['MONGOID_VERSION'] || ENV['MONGO_MAPPER_VERSION']
ENV['MONGOID_VERSION'] = '5.0' unless ENV['MONGOID_VERSION'] || ENV['MONGO_MAPPER_VERSION']

if ENV['MONGOID_VERSION']
case version = ENV['MONGOID_VERSION'] || '~> 4.0'
when /4/
case version = ENV['MONGOID_VERSION']
when /^5/
gem 'mongoid', '~> 5.0'
when /^4/
gem 'mongoid', '~> 4.0'
when /3/
when /^3/
gem 'mongoid', '~> 3.1'
else
gem 'mongoid', version
Expand Down

0 comments on commit ea89fb0

Please sign in to comment.