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

Upgrade Mongoid to version 9.0.0 #245

Merged
merged 6 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- { ruby: '3.0', mongodb: '4.4', gemfile: 'mongoid_8', bundler: '2.4.19' }
- { ruby: '3.1', mongodb: '4.4', gemfile: 'mongoid_8', bundler: '2.4.19' }
- { ruby: '3.2', mongodb: '4.4', gemfile: 'mongoid_8', bundler: '2.4.19' }
- { ruby: '3.2', mongodb: '4.4', gemfile: 'mongoid_9', bundler: '2.4.19' }
name: test (ruby=${{ matrix.entry.ruby }}, mongodb=${{ matrix.entry.mongodb }}), gemfile=${{ matrix.entry.gemfile }})
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.entry.gemfile }}.gemfile
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
appraise 'mongoid-9' do
gem 'mongoid', '~> 9.0.0'
end

appraise 'mongoid-8' do
gem 'mongoid', '~> 8.0.0'
gem 'rails', '~> 7.0'
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 4.1.1 (Next)
### 4.2.0 (Next)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/mongoid/mongoid-rspec/blob/master/lib/mongoid/rspec/version.rb also needs to be incremented. Can be done in your next PR.

* [#239](https://github.com/mongoid/mongoid-rspec/pull/239): Add support for if/unless validator options - [@knovoselic](https://github.com/knovoselic).
* [#244](https://github.com/mongoid/mongoid-rspec/pull/123): Migration from TravisCI to GitHub Actions - [@skalibog](https://github.com/skalibog).
* [#244](https://github.com/mongoid/mongoid-rspec/pull/244): Migration from TravisCI to GitHub Actions - [@skalibog](https://github.com/skalibog).
* [#245](https://github.com/mongoid/mongoid-rspec/pull/245): Added Support for Mongoid v9.0.0 - [@saisrinivasan](https://github.com/SairamSrinivasan).
* Your contribution here.
sairamsrinivasan marked this conversation as resolved.
Show resolved Hide resolved

### 4.1.0 (6/12/2020)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The mongoid-rspec library provides a collection of RSpec-compatible matchers tha

[Tested](https://github.com/mongoid/mongoid-locker/actions) against:
- MRI: `2.6.x`, `2.7.x`, `3.0.x`, `3.1.x`, `3.2.x`
- Mongoid: `4`, `5`, `6`, `7`, `8`
- Mongoid: `4`, `5`, `6`, `7`, `8`, `9`

See [.github/workflows/rspec.yml](.github/workflows/rspec.yml) for the latest test matrix.

Expand All @@ -25,7 +25,7 @@ end

## Compatibility

This gem is compatible with Mongoid 3, 4, 5, 6 and 7.
This gem is compatible with Mongoid 3, 4, 5, 6, 7, 8, 9.

## Configuration

Expand Down
7 changes: 7 additions & 0 deletions gemfiles/mongoid_9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'

gem 'mongoid', '~> 9.0.0'

gemspec path: '../'
2 changes: 1 addition & 1 deletion mongoid-rspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec'
s.add_development_dependency 'rubocop', '~> 1.36.0'

s.add_dependency 'mongoid', '>= 3.0', '< 9.0'
s.add_dependency 'mongoid', '>= 3.0', '< 10.0'
s.add_dependency 'mongoid-compatibility', '>= 0.5.1'

s.files = Dir.glob('lib/**/*') + %w[LICENSE README.md Rakefile]
Expand Down
4 changes: 3 additions & 1 deletion spec/models/permalink.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class Permalink
include Mongoid::Document

embedded_in :linkable, inverse_of: :link
embedded_in :linkable,
inverse_of: :link,
touch: false
end
2 changes: 1 addition & 1 deletion spec/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Profile
field :age
field :hobbies, type: Array, default: []

embedded_in :user, inverse_of: :profile
embedded_in :user, inverse_of: :profile, touch: false
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


validates :age, numericality: { greater_than: 0 }
validates :terms_of_service, acceptance: true
Expand Down
Loading