Skip to content

Commit

Permalink
Add mongoid 6 to travis test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
joostverdoorn committed May 26, 2016
1 parent 5a6aa29 commit 4b34688
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ bundler_args: --without development
rvm:
- 2.0.0
- 2.1.1
- 2.2
- 2.2.2

gemfile:
- Gemfile
- gemfiles/mongoid4.gemfile
- gemfiles/mongoid6.gemfile

env:
global:
Expand All @@ -19,6 +20,13 @@ env:
- MONGODB=2.4.14
- MONGODB=2.6.10

matrix:
exclude:
- rvm: 2.0.0
gemfile: gemfiles/mongoid6.gemfile
- rvm: 2.1.1
gemfile: gemfiles/mongoid6.gemfile

before_script:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz -O /tmp/mongodb.tgz
- tar -xvf /tmp/mongodb.tgz
Expand Down
18 changes: 18 additions & 0 deletions gemfiles/mongoid6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source 'https://rubygems.org'

gemspec path: '..'

gem 'bundler'
gem 'rake'
gem 'pry'
gem 'mongoid', github: 'mongodb/mongoid', ref: '7c2ff52a0c5292b8e6bf3a9a29bbb19abae3dd5f'

group :test do
gem 'rspec-given', '~> 3.5'
gem 'codeclimate-test-reporter', require: nil
end

group :doc do
gem 'yard'
gem 'yard-tomdoc'
end
7 changes: 6 additions & 1 deletion spec/support/models/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ class Game
field :name

belongs_to :person, index: true, validate: true
belongs_to :parent, class_name: "Game", foreign_key: "parent-id"

if Mongoid::VERSION >= "6.0.0"
belongs_to :parent, class_name: "Game", foreign_key: "parent-id", optional: true
else
belongs_to :parent, class_name: "Game", foreign_key: "parent-id"
end

accepts_nested_attributes_for :person

Expand Down

0 comments on commit 4b34688

Please sign in to comment.