Skip to content

Commit

Permalink
Upgrade Mongoid to version 9.0.0 (#245)
Browse files Browse the repository at this point in the history
* Upgrade to version 9

* update changelog

* bump up version in changelog and add to ci

* add to appraisal file

* fix rubocop

* update changelog
  • Loading branch information
sairamsrinivasan authored May 12, 2024
1 parent 8bb0c65 commit f55e0f9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 7 deletions.
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)

* [#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): Add support for Mongoid 9 - [@saisrinivasan](https://github.com/SairamSrinivasan).
* Your contribution here.

### 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

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

0 comments on commit f55e0f9

Please sign in to comment.