Skip to content

Commit 76564df

Browse files
authored
Add support for Mongoid 7 (#15)
1 parent 2282c3b commit 76564df

57 files changed

Lines changed: 266 additions & 5528 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_WITHOUT: "development"

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,32 @@ language: ruby
33
bundler_args: --without development
44

55
rvm:
6-
- 2.3.3
6+
- 2.7.1
77

88
gemfile:
99
- Gemfile
10-
- gemfiles/mongoid6.gemfile
10+
- gemfiles/mongoid7.gemfile
1111

1212
env:
1313
global:
1414
- CI="travis"
1515
- JRUBY_OPTS="--server -J-Xms512m -J-Xmx1024m"
16+
- CC_TEST_REPORTER_ID=fd17c835d3e49ec85fddd67f8834b7652021efd7653d8d00f8be67d6229bdc2e
1617
matrix:
17-
- MONGODB=2.6.10
18+
- MONGODB=4.0.3
1819

1920
before_script:
2021
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz -O /tmp/mongodb.tgz
2122
- tar -xvf /tmp/mongodb.tgz
2223
- mkdir /tmp/data
2324
- ${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --auth &> /dev/null &
2425

26+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
27+
- chmod +x ./cc-test-reporter
28+
- ./cc-test-reporter before-build
29+
30+
after_script:
31+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
32+
2533
notifications:
2634
email: false

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Mongoid::Includes 3.0.0 (2020-10-29) ##
2+
3+
* Add support for Mongoid `7.1`.
4+
* Avoid making a query when the foreign keys are empty.
5+
16
## Mongoid::Includes 2.1.0 (2017-07-03) ##
27

38
* Fix bug where `includes` ignores the `:with` option if the association is polymorphic. Thanks @nickcherry for the bug report!

Gemfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ gemspec
44

55
gem 'bundler'
66
gem 'rake'
7-
gem 'pry'
8-
gem 'mongoid', '6.0.1'
7+
gem 'pry-byebug'
8+
gem 'mongoid', '~> 7.1.0'
99

1010
group :test do
1111
gem 'rspec-given', '~> 3.5'
12-
gem 'codeclimate-test-reporter', require: nil
13-
end
14-
15-
group :doc do
16-
gem 'yard'
17-
gem 'yard-tomdoc'
12+
gem 'simplecov', '~> 0.17.0', require: false
1813
end

Gemfile.lock

Lines changed: 56 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,83 @@
11
PATH
22
remote: .
33
specs:
4-
mongoid_includes (2.0.0)
5-
mongoid (>= 6.0.1, < 7.0.0)
4+
mongoid_includes (3.0.0)
5+
mongoid (>= 7.0.10, < 8.0.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
activemodel (5.0.1)
11-
activesupport (= 5.0.1)
12-
activesupport (5.0.1)
10+
activemodel (6.0.3.4)
11+
activesupport (= 6.0.3.4)
12+
activesupport (6.0.3.4)
1313
concurrent-ruby (~> 1.0, >= 1.0.2)
14-
i18n (~> 0.7)
14+
i18n (>= 0.7, < 2)
1515
minitest (~> 5.1)
1616
tzinfo (~> 1.1)
17-
bson (4.2.1)
18-
codeclimate-test-reporter (0.4.7)
19-
simplecov (>= 0.7.1, < 1.0.0)
20-
coderay (1.1.0)
21-
concurrent-ruby (1.0.4)
22-
diff-lcs (1.2.5)
23-
docile (1.1.5)
24-
given_core (3.7.1)
17+
zeitwerk (~> 2.2, >= 2.2.2)
18+
bson (4.11.0)
19+
byebug (11.1.3)
20+
coderay (1.1.3)
21+
concurrent-ruby (1.1.7)
22+
diff-lcs (1.4.4)
23+
docile (1.3.2)
24+
given_core (3.8.1)
2525
sorcerer (>= 0.3.7)
26-
i18n (0.7.0)
27-
json (1.8.3)
28-
method_source (0.8.2)
29-
minitest (5.10.1)
30-
mongo (2.4.1)
31-
bson (>= 4.2.1, < 5.0.0)
32-
mongoid (6.0.1)
33-
activemodel (~> 5.0)
34-
mongo (~> 2.3)
35-
pry (0.10.1)
36-
coderay (~> 1.1.0)
37-
method_source (~> 0.8.1)
38-
slop (~> 3.4)
39-
rake (10.4.2)
40-
rspec (3.3.0)
41-
rspec-core (~> 3.3.0)
42-
rspec-expectations (~> 3.3.0)
43-
rspec-mocks (~> 3.3.0)
44-
rspec-core (3.3.2)
45-
rspec-support (~> 3.3.0)
46-
rspec-expectations (3.3.1)
26+
i18n (1.8.5)
27+
concurrent-ruby (~> 1.0)
28+
json (2.3.1)
29+
method_source (1.0.0)
30+
minitest (5.14.2)
31+
mongo (2.13.1)
32+
bson (>= 4.8.2, < 5.0.0)
33+
mongoid (7.1.4)
34+
activemodel (>= 5.1, < 6.1)
35+
mongo (>= 2.7.0, < 3.0.0)
36+
pry (0.13.1)
37+
coderay (~> 1.1)
38+
method_source (~> 1.0)
39+
pry-byebug (3.9.0)
40+
byebug (~> 11.0)
41+
pry (~> 0.13.0)
42+
rake (13.0.1)
43+
rspec (3.9.0)
44+
rspec-core (~> 3.9.0)
45+
rspec-expectations (~> 3.9.0)
46+
rspec-mocks (~> 3.9.0)
47+
rspec-core (3.9.3)
48+
rspec-support (~> 3.9.3)
49+
rspec-expectations (3.9.3)
4750
diff-lcs (>= 1.2.0, < 2.0)
48-
rspec-support (~> 3.3.0)
49-
rspec-given (3.7.1)
50-
given_core (= 3.7.1)
51+
rspec-support (~> 3.9.0)
52+
rspec-given (3.8.1)
53+
given_core (= 3.8.1)
5154
rspec (>= 2.14.0)
52-
rspec-mocks (3.3.2)
55+
rspec-mocks (3.9.1)
5356
diff-lcs (>= 1.2.0, < 2.0)
54-
rspec-support (~> 3.3.0)
55-
rspec-support (3.3.0)
56-
simplecov (0.10.0)
57-
docile (~> 1.1.0)
58-
json (~> 1.8)
57+
rspec-support (~> 3.9.0)
58+
rspec-support (3.9.4)
59+
simplecov (0.17.1)
60+
docile (~> 1.1)
61+
json (>= 1.8, < 3)
5962
simplecov-html (~> 0.10.0)
60-
simplecov-html (0.10.0)
61-
slop (3.6.0)
62-
sorcerer (1.0.2)
63-
thread_safe (0.3.5)
64-
tomparse (0.4.2)
65-
tzinfo (1.2.2)
63+
simplecov-html (0.10.2)
64+
sorcerer (2.0.1)
65+
thread_safe (0.3.6)
66+
tzinfo (1.2.7)
6667
thread_safe (~> 0.1)
67-
yard (0.8.7.6)
68-
yard-tomdoc (0.7.1)
69-
tomparse (>= 0.4.0)
70-
yard
68+
zeitwerk (2.4.1)
7169

7270
PLATFORMS
7371
ruby
7472

7573
DEPENDENCIES
7674
bundler
77-
codeclimate-test-reporter
78-
mongoid (= 6.0.1)
75+
mongoid (~> 7.1.0)
7976
mongoid_includes!
80-
pry
77+
pry-byebug
8178
rake
8279
rspec-given (~> 3.5)
83-
yard
84-
yard-tomdoc
80+
simplecov (~> 0.17.0)
8581

8682
BUNDLED WITH
87-
1.12.5
83+
2.1.4

bin/rspec

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rspec' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("rspec-core", "rspec")

doc/Mongoid.html

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)