From 3d68bf4343f33b974425b134e545aeec966389be Mon Sep 17 00:00:00 2001 From: Rolando Sierra Date: Thu, 29 Oct 2026 14:23:09 -0600 Subject: [PATCH 1/4] Add CI matrix and Mongoid 8 compatibility Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 30 +++++++++ changes.md | 6 ++ gemfiles/mongoid_7_4.gemfile | 5 ++ gemfiles/mongoid_7_4.gemfile.lock | 101 +++++++++++++++++++++++++++++ gemfiles/mongoid_8_0.gemfile | 5 ++ gemfiles/mongoid_8_0.gemfile.lock | 101 +++++++++++++++++++++++++++++ gemfiles/mongoid_8_1.gemfile | 5 ++ gemfiles/mongoid_8_1.gemfile.lock | 102 ++++++++++++++++++++++++++++++ lib/mongoidal/bulk_savable.rb | 2 +- lib/mongoidal/nesting.rb | 4 +- lib/mongoidal/version.rb | 2 +- mongoidal.gemspec | 3 +- spec/bulk_savable_spec.rb | 41 ++++++++++++ spec/global_id_spec.rb | 43 +++++++++++++ spec/nesting_spec.rb | 4 +- spec/spec_helper.rb | 2 +- 16 files changed, 447 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 gemfiles/mongoid_7_4.gemfile create mode 100644 gemfiles/mongoid_7_4.gemfile.lock create mode 100644 gemfiles/mongoid_8_0.gemfile create mode 100644 gemfiles/mongoid_8_0.gemfile.lock create mode 100644 gemfiles/mongoid_8_1.gemfile create mode 100644 gemfiles/mongoid_8_1.gemfile.lock create mode 100644 spec/bulk_savable_spec.rb create mode 100644 spec/global_id_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..28cd875 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ['3.0', '3.2'] + mongoid: ['7_4', '8_0', '8_1'] + env: + BUNDLE_GEMFILE: gemfiles/mongoid_${{ matrix.mongoid }}.gemfile + CI: 'true' + services: + mongo: + image: mongo:7.0 + ports: + - 27017:27017 + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rspec diff --git a/changes.md b/changes.md index 901b29d..44d1333 100644 --- a/changes.md +++ b/changes.md @@ -1,3 +1,9 @@ +# 0.3.0 +- Added GitHub Actions CI: Mongoid 7.4 / 8.0 / 8.1 x Ruby 3.0 / 3.2 against mongo:7.0 +- Verified compatibility with Mongoid 8.0 and 8.1 +- Fixed BulkSavable#bulk_assign NameError when no embeds are given +- Fixed Nesting#nested_save! argument forwarding on Ruby 3 +- Loosened dev dependencies (mongoid >= 7.4, < 8.2; dropped bundler ~> 1.6) # 0.2.6 - Upgraded Mongoid to 7.4.x # 0.2.5 diff --git a/gemfiles/mongoid_7_4.gemfile b/gemfiles/mongoid_7_4.gemfile new file mode 100644 index 0000000..caf6ad3 --- /dev/null +++ b/gemfiles/mongoid_7_4.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'mongoid', '~> 7.4.0' + +gemspec path: '..' diff --git a/gemfiles/mongoid_7_4.gemfile.lock b/gemfiles/mongoid_7_4.gemfile.lock new file mode 100644 index 0000000..03a023f --- /dev/null +++ b/gemfiles/mongoid_7_4.gemfile.lock @@ -0,0 +1,101 @@ +PATH + remote: .. + specs: + mongoidal (0.2.6) + mongoid-slug + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.0.10) + activesupport (= 7.0.10) + activesupport (7.0.10) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.3) + bson (5.2.0) + concurrent-ruby (1.3.8) + connection_pool (2.5.5) + diff-lcs (1.6.2) + drb (2.2.3) + globalid (1.4.0) + activesupport (>= 6.1) + i18n (1.14.8) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (5.26.1) + mongo (2.26.0) + base64 + bson (>= 4.14.1, < 6.0.0) + mongoid (7.4.3) + activemodel (>= 5.1, < 7.1, != 7.0.0) + mongo (>= 2.10.5, < 3.0.0) + ruby2_keywords (~> 0.0.5) + mongoid-compatibility (1.1.0) + activesupport + mongoid (>= 2.0) + mongoid-rspec (4.4.0) + mongoid (>= 3.0, < 10.0) + mongoid-compatibility (>= 0.5.1) + mongoid-slug (7.1.0) + mongoid (>= 7.0) + stringex (~> 2.0) + mutex_m (0.3.0) + rack (3.2.7) + rake (13.4.2) + redis-client (0.31.0) + connection_pool + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + ruby2_keywords (0.0.5) + securerandom (0.3.2) + sidekiq (7.3.10) + base64 + connection_pool (>= 2.3.0, < 3) + logger + rack (>= 2.2.4, < 3.3) + redis-client (>= 0.23.0, < 1) + stringex (2.8.6) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + arm64-darwin-24 + +DEPENDENCIES + globalid + mongoid (~> 7.4.0) + mongoid-rspec + mongoidal! + rake + rspec + rspec-its + sidekiq + +BUNDLED WITH + 2.2.33 diff --git a/gemfiles/mongoid_8_0.gemfile b/gemfiles/mongoid_8_0.gemfile new file mode 100644 index 0000000..d976ee6 --- /dev/null +++ b/gemfiles/mongoid_8_0.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'mongoid', '~> 8.0.0' + +gemspec path: '..' diff --git a/gemfiles/mongoid_8_0.gemfile.lock b/gemfiles/mongoid_8_0.gemfile.lock new file mode 100644 index 0000000..17a5fcf --- /dev/null +++ b/gemfiles/mongoid_8_0.gemfile.lock @@ -0,0 +1,101 @@ +PATH + remote: .. + specs: + mongoidal (0.2.6) + mongoid-slug + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.0.10) + activesupport (= 7.0.10) + activesupport (7.0.10) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.3) + bson (5.2.0) + concurrent-ruby (1.3.8) + connection_pool (2.5.5) + diff-lcs (1.6.2) + drb (2.2.3) + globalid (1.4.0) + activesupport (>= 6.1) + i18n (1.14.8) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (5.26.1) + mongo (2.26.0) + base64 + bson (>= 4.14.1, < 6.0.0) + mongoid (8.0.1) + activemodel (>= 5.1, < 7.1, != 7.0.0) + mongo (>= 2.18.0, < 3.0.0) + ruby2_keywords (~> 0.0.5) + mongoid-compatibility (1.1.0) + activesupport + mongoid (>= 2.0) + mongoid-rspec (4.4.0) + mongoid (>= 3.0, < 10.0) + mongoid-compatibility (>= 0.5.1) + mongoid-slug (7.1.0) + mongoid (>= 7.0) + stringex (~> 2.0) + mutex_m (0.3.0) + rack (3.2.7) + rake (13.4.2) + redis-client (0.31.0) + connection_pool + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + ruby2_keywords (0.0.5) + securerandom (0.3.2) + sidekiq (7.3.10) + base64 + connection_pool (>= 2.3.0, < 3) + logger + rack (>= 2.2.4, < 3.3) + redis-client (>= 0.23.0, < 1) + stringex (2.8.6) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + arm64-darwin-24 + +DEPENDENCIES + globalid + mongoid (~> 8.0.0) + mongoid-rspec + mongoidal! + rake + rspec + rspec-its + sidekiq + +BUNDLED WITH + 2.2.33 diff --git a/gemfiles/mongoid_8_1.gemfile b/gemfiles/mongoid_8_1.gemfile new file mode 100644 index 0000000..6a394a4 --- /dev/null +++ b/gemfiles/mongoid_8_1.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'mongoid', '~> 8.1.0' + +gemspec path: '..' diff --git a/gemfiles/mongoid_8_1.gemfile.lock b/gemfiles/mongoid_8_1.gemfile.lock new file mode 100644 index 0000000..5d28eb5 --- /dev/null +++ b/gemfiles/mongoid_8_1.gemfile.lock @@ -0,0 +1,102 @@ +PATH + remote: .. + specs: + mongoidal (0.2.6) + mongoid-slug + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.0.10) + activesupport (= 7.0.10) + activesupport (7.0.10) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.3) + bson (5.2.0) + concurrent-ruby (1.3.8) + connection_pool (2.5.5) + diff-lcs (1.6.2) + drb (2.2.3) + globalid (1.4.0) + activesupport (>= 6.1) + i18n (1.14.8) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (5.26.1) + mongo (2.26.0) + base64 + bson (>= 4.14.1, < 6.0.0) + mongoid (8.1.13) + activemodel (>= 5.1, < 8.1, != 7.0.0) + concurrent-ruby (>= 1.0.5, < 2.0) + mongo (>= 2.18.0, < 3.0.0) + ruby2_keywords (~> 0.0.5) + mongoid-compatibility (1.1.0) + activesupport + mongoid (>= 2.0) + mongoid-rspec (4.4.0) + mongoid (>= 3.0, < 10.0) + mongoid-compatibility (>= 0.5.1) + mongoid-slug (7.1.0) + mongoid (>= 7.0) + stringex (~> 2.0) + mutex_m (0.3.0) + rack (3.2.7) + rake (13.4.2) + redis-client (0.31.0) + connection_pool + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + ruby2_keywords (0.0.5) + securerandom (0.3.2) + sidekiq (7.3.10) + base64 + connection_pool (>= 2.3.0, < 3) + logger + rack (>= 2.2.4, < 3.3) + redis-client (>= 0.23.0, < 1) + stringex (2.8.6) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + arm64-darwin-24 + +DEPENDENCIES + globalid + mongoid (~> 8.1.0) + mongoid-rspec + mongoidal! + rake + rspec + rspec-its + sidekiq + +BUNDLED WITH + 2.2.33 diff --git a/lib/mongoidal/bulk_savable.rb b/lib/mongoidal/bulk_savable.rb index cfdf76c..115486c 100644 --- a/lib/mongoidal/bulk_savable.rb +++ b/lib/mongoidal/bulk_savable.rb @@ -8,7 +8,7 @@ module BulkSavable # If a specific set of embed relations are not provided then all embeds_many relations will be used def bulk_assign(attributes, *embeds) if embeds.blank? - embeds = self.class.relations.select {|k, v| v.is_a?(Mongoid::Association::Referenced::EmbesMany) }.keys + embeds = self.class.relations.select {|k, v| v.is_a?(Mongoid::Association::Embedded::EmbedsMany) }.keys end root_attrs = attributes.except(*embeds) diff --git a/lib/mongoidal/nesting.rb b/lib/mongoidal/nesting.rb index fa01d2a..17bacbf 100644 --- a/lib/mongoidal/nesting.rb +++ b/lib/mongoidal/nesting.rb @@ -56,8 +56,8 @@ def nested_assign(attributes, position: nil) # and insert/update/delete them one by one based off of the existing data, # instead of just replacing the entire array like a normal save would do. # Any items not present within the new array will be destroyed - def nested_save!(attributes, *embeds, &block) - to_delete = nested_assign(attributes, *embeds) + def nested_save!(attributes, **options, &block) + to_delete = nested_assign(attributes, **options) if valid? block.call(to_delete) if block_given? to_delete.each(&:destroy) diff --git a/lib/mongoidal/version.rb b/lib/mongoidal/version.rb index fad807e..ec61efe 100644 --- a/lib/mongoidal/version.rb +++ b/lib/mongoidal/version.rb @@ -1,3 +1,3 @@ module Mongoidal - VERSION = "0.2.6" + VERSION = "0.3.0" end diff --git a/mongoidal.gemspec b/mongoidal.gemspec index fc2e833..d0d05d6 100644 --- a/mongoidal.gemspec +++ b/mongoidal.gemspec @@ -18,8 +18,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "mongoid-slug" - spec.add_development_dependency "mongoid", '~> 7.4.0' - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "mongoid", ">= 7.4", "< 8.2" spec.add_development_dependency "sidekiq" spec.add_development_dependency "globalid" spec.add_development_dependency "rake" diff --git a/spec/bulk_savable_spec.rb b/spec/bulk_savable_spec.rb new file mode 100644 index 0000000..8a3effe --- /dev/null +++ b/spec/bulk_savable_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +class BulkParent + include Mongoid::Document + include Mongoidal::BulkSavable + field :name, type: String + embeds_many :kids, class_name: 'BulkKid' +end + +class BulkKid + include Mongoid::Document + embedded_in :bulk_parent + field :name, type: String +end + +describe Mongoidal::BulkSavable do + let(:parent) { BulkParent.create(name: 'Parent') } + let!(:kid1) { parent.kids.create(name: 'Kid 1') } + let!(:kid2) { parent.kids.create(name: 'Kid 2') } + + # with no embeds given, every embeds_many relation is used + it 'updates, adds and flags deletes across embeds_many relations' do + to_delete = parent.bulk_assign( + 'name' => 'Renamed', + 'kids' => [ + { 'id' => kid1.id.to_s, 'name' => 'Kid 1b' }, + { 'id' => kid2.id.to_s, 'deleted' => true }, + { 'name' => 'Kid 3' } + ] + ) + + expect(parent.name).to eq 'Renamed' + expect(parent.kids.map(&:name)).to match_array ['Kid 1b', 'Kid 2', 'Kid 3'] + expect(to_delete).to eq [kid2] + end + + it 'accepts an explicit list of embeds' do + parent.bulk_assign({ kids: [{ id: kid1.id, name: 'Kid 1b' }] }, :kids) + expect(parent.kids.find(kid1.id).name).to eq 'Kid 1b' + end +end diff --git a/spec/global_id_spec.rb b/spec/global_id_spec.rb new file mode 100644 index 0000000..1261028 --- /dev/null +++ b/spec/global_id_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +class GidParent + include Mongoid::Document + include Mongoidal::Identification + field :name, type: String + embeds_many :kids, class_name: 'GidKid' +end + +class GidKid + include Mongoid::Document + include Mongoidal::Identification + embedded_in :gid_parent + field :name, type: String +end + +GlobalID.app = 'mongoidal' + +describe Mongoidal::Identification do + let(:parent) { GidParent.create(name: 'Parent') } + let(:kid) { parent.kids.create(name: 'Kid') } + + def locate(doc) + Mongoidal::Locator.new(GlobalID.parse(doc.to_global_id.to_s)).locate + end + + it 'round trips a root document' do + expect(locate(parent)).to eq parent + end + + it 'round trips an embedded document through its root' do + expect(locate(kid)).to eq kid + end + + it 'rebuilds a destroyed embedded document from its attributes' do + gid = kid.to_global_id.to_s + kid.destroy + gid = kid.to_global_id.to_s + found = Mongoidal::Locator.new(GlobalID.parse(gid)).locate + expect(found.name).to eq 'Kid' + expect(found).to be_destroyed + end +end diff --git a/spec/nesting_spec.rb b/spec/nesting_spec.rb index eeac66d..0407e31 100644 --- a/spec/nesting_spec.rb +++ b/spec/nesting_spec.rb @@ -76,7 +76,7 @@ def self.find_within_collection(collection, attrs) end it 'should match using find_within_collection' do - parent.nested_save!(kids:[{name: 'Kid 1', age: 4}]) + parent.nested_save!({kids: [{name: "Kid 1", age: 4}]}) expect(kid1.age).to eq 4 end @@ -107,7 +107,7 @@ def self.find_within_collection(collection, attrs) # this is standard functionality it 'should update existing favorite' do expect(parent.favorite.name).to eq 'Kid 1' - parent.nested_assign(favorite: {name: 'Kid 2'}) + parent.nested_assign({favorite: {name: 'Kid 2'}}) expect(parent.favorite.id).to eq favorite.id end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2107a59..8ae14d8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,7 @@ end config.after(:suite) do - Mongoid::Threaded.sessions[:default].drop if ENV['CI'] + Mongoid.default_client.database.drop if ENV["CI"] end # rspec-expectations config goes here. You can use an alternate From ee034354783a721b78f4028f709e0ebb6ae392de Mon Sep 17 00:00:00 2001 From: Rolando Sierra Date: Fri, 30 Oct 2026 08:52:22 -0600 Subject: [PATCH 2/4] Stop committing gemfile lockfiles They were generated on macOS and break bundle install on the Linux CI runners. Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 1 + gemfiles/mongoid_7_4.gemfile.lock | 101 ----------------------------- gemfiles/mongoid_8_0.gemfile.lock | 101 ----------------------------- gemfiles/mongoid_8_1.gemfile.lock | 102 ------------------------------ 4 files changed, 1 insertion(+), 304 deletions(-) delete mode 100644 gemfiles/mongoid_7_4.gemfile.lock delete mode 100644 gemfiles/mongoid_8_0.gemfile.lock delete mode 100644 gemfiles/mongoid_8_1.gemfile.lock diff --git a/.gitignore b/.gitignore index 31cafb5..489e485 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ tmp *.o *.a mkmf.log +gemfiles/*.gemfile.lock diff --git a/gemfiles/mongoid_7_4.gemfile.lock b/gemfiles/mongoid_7_4.gemfile.lock deleted file mode 100644 index 03a023f..0000000 --- a/gemfiles/mongoid_7_4.gemfile.lock +++ /dev/null @@ -1,101 +0,0 @@ -PATH - remote: .. - specs: - mongoidal (0.2.6) - mongoid-slug - -GEM - remote: https://rubygems.org/ - specs: - activemodel (7.0.10) - activesupport (= 7.0.10) - activesupport (7.0.10) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - mutex_m - securerandom (>= 0.3) - tzinfo (~> 2.0) - base64 (0.3.0) - benchmark (0.5.0) - bigdecimal (4.1.3) - bson (5.2.0) - concurrent-ruby (1.3.8) - connection_pool (2.5.5) - diff-lcs (1.6.2) - drb (2.2.3) - globalid (1.4.0) - activesupport (>= 6.1) - i18n (1.14.8) - concurrent-ruby (~> 1.0) - logger (1.7.0) - minitest (5.26.1) - mongo (2.26.0) - base64 - bson (>= 4.14.1, < 6.0.0) - mongoid (7.4.3) - activemodel (>= 5.1, < 7.1, != 7.0.0) - mongo (>= 2.10.5, < 3.0.0) - ruby2_keywords (~> 0.0.5) - mongoid-compatibility (1.1.0) - activesupport - mongoid (>= 2.0) - mongoid-rspec (4.4.0) - mongoid (>= 3.0, < 10.0) - mongoid-compatibility (>= 0.5.1) - mongoid-slug (7.1.0) - mongoid (>= 7.0) - stringex (~> 2.0) - mutex_m (0.3.0) - rack (3.2.7) - rake (13.4.2) - redis-client (0.31.0) - connection_pool - rspec (3.13.2) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.6) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.5) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-its (2.0.0) - rspec-core (>= 3.13.0) - rspec-expectations (>= 3.13.0) - rspec-mocks (3.13.8) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.7) - ruby2_keywords (0.0.5) - securerandom (0.3.2) - sidekiq (7.3.10) - base64 - connection_pool (>= 2.3.0, < 3) - logger - rack (>= 2.2.4, < 3.3) - redis-client (>= 0.23.0, < 1) - stringex (2.8.6) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - -PLATFORMS - arm64-darwin-24 - -DEPENDENCIES - globalid - mongoid (~> 7.4.0) - mongoid-rspec - mongoidal! - rake - rspec - rspec-its - sidekiq - -BUNDLED WITH - 2.2.33 diff --git a/gemfiles/mongoid_8_0.gemfile.lock b/gemfiles/mongoid_8_0.gemfile.lock deleted file mode 100644 index 17a5fcf..0000000 --- a/gemfiles/mongoid_8_0.gemfile.lock +++ /dev/null @@ -1,101 +0,0 @@ -PATH - remote: .. - specs: - mongoidal (0.2.6) - mongoid-slug - -GEM - remote: https://rubygems.org/ - specs: - activemodel (7.0.10) - activesupport (= 7.0.10) - activesupport (7.0.10) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - mutex_m - securerandom (>= 0.3) - tzinfo (~> 2.0) - base64 (0.3.0) - benchmark (0.5.0) - bigdecimal (4.1.3) - bson (5.2.0) - concurrent-ruby (1.3.8) - connection_pool (2.5.5) - diff-lcs (1.6.2) - drb (2.2.3) - globalid (1.4.0) - activesupport (>= 6.1) - i18n (1.14.8) - concurrent-ruby (~> 1.0) - logger (1.7.0) - minitest (5.26.1) - mongo (2.26.0) - base64 - bson (>= 4.14.1, < 6.0.0) - mongoid (8.0.1) - activemodel (>= 5.1, < 7.1, != 7.0.0) - mongo (>= 2.18.0, < 3.0.0) - ruby2_keywords (~> 0.0.5) - mongoid-compatibility (1.1.0) - activesupport - mongoid (>= 2.0) - mongoid-rspec (4.4.0) - mongoid (>= 3.0, < 10.0) - mongoid-compatibility (>= 0.5.1) - mongoid-slug (7.1.0) - mongoid (>= 7.0) - stringex (~> 2.0) - mutex_m (0.3.0) - rack (3.2.7) - rake (13.4.2) - redis-client (0.31.0) - connection_pool - rspec (3.13.2) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.6) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.5) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-its (2.0.0) - rspec-core (>= 3.13.0) - rspec-expectations (>= 3.13.0) - rspec-mocks (3.13.8) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.7) - ruby2_keywords (0.0.5) - securerandom (0.3.2) - sidekiq (7.3.10) - base64 - connection_pool (>= 2.3.0, < 3) - logger - rack (>= 2.2.4, < 3.3) - redis-client (>= 0.23.0, < 1) - stringex (2.8.6) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - -PLATFORMS - arm64-darwin-24 - -DEPENDENCIES - globalid - mongoid (~> 8.0.0) - mongoid-rspec - mongoidal! - rake - rspec - rspec-its - sidekiq - -BUNDLED WITH - 2.2.33 diff --git a/gemfiles/mongoid_8_1.gemfile.lock b/gemfiles/mongoid_8_1.gemfile.lock deleted file mode 100644 index 5d28eb5..0000000 --- a/gemfiles/mongoid_8_1.gemfile.lock +++ /dev/null @@ -1,102 +0,0 @@ -PATH - remote: .. - specs: - mongoidal (0.2.6) - mongoid-slug - -GEM - remote: https://rubygems.org/ - specs: - activemodel (7.0.10) - activesupport (= 7.0.10) - activesupport (7.0.10) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - mutex_m - securerandom (>= 0.3) - tzinfo (~> 2.0) - base64 (0.3.0) - benchmark (0.5.0) - bigdecimal (4.1.3) - bson (5.2.0) - concurrent-ruby (1.3.8) - connection_pool (2.5.5) - diff-lcs (1.6.2) - drb (2.2.3) - globalid (1.4.0) - activesupport (>= 6.1) - i18n (1.14.8) - concurrent-ruby (~> 1.0) - logger (1.7.0) - minitest (5.26.1) - mongo (2.26.0) - base64 - bson (>= 4.14.1, < 6.0.0) - mongoid (8.1.13) - activemodel (>= 5.1, < 8.1, != 7.0.0) - concurrent-ruby (>= 1.0.5, < 2.0) - mongo (>= 2.18.0, < 3.0.0) - ruby2_keywords (~> 0.0.5) - mongoid-compatibility (1.1.0) - activesupport - mongoid (>= 2.0) - mongoid-rspec (4.4.0) - mongoid (>= 3.0, < 10.0) - mongoid-compatibility (>= 0.5.1) - mongoid-slug (7.1.0) - mongoid (>= 7.0) - stringex (~> 2.0) - mutex_m (0.3.0) - rack (3.2.7) - rake (13.4.2) - redis-client (0.31.0) - connection_pool - rspec (3.13.2) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.6) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.5) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-its (2.0.0) - rspec-core (>= 3.13.0) - rspec-expectations (>= 3.13.0) - rspec-mocks (3.13.8) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.7) - ruby2_keywords (0.0.5) - securerandom (0.3.2) - sidekiq (7.3.10) - base64 - connection_pool (>= 2.3.0, < 3) - logger - rack (>= 2.2.4, < 3.3) - redis-client (>= 0.23.0, < 1) - stringex (2.8.6) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - -PLATFORMS - arm64-darwin-24 - -DEPENDENCIES - globalid - mongoid (~> 8.1.0) - mongoid-rspec - mongoidal! - rake - rspec - rspec-its - sidekiq - -BUNDLED WITH - 2.2.33 From 0ce86bbe5f477b14ce7ff8c853511983db0a5024 Mon Sep 17 00:00:00 2001 From: Rolando Sierra Date: Fri, 30 Oct 2026 08:52:32 -0600 Subject: [PATCH 3/4] Remove dead assignment in global id spec Co-Authored-By: Claude Sonnet 5.5 --- spec/global_id_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/global_id_spec.rb b/spec/global_id_spec.rb index 1261028..48d0dc2 100644 --- a/spec/global_id_spec.rb +++ b/spec/global_id_spec.rb @@ -33,7 +33,6 @@ def locate(doc) end it 'rebuilds a destroyed embedded document from its attributes' do - gid = kid.to_global_id.to_s kid.destroy gid = kid.to_global_id.to_s found = Mongoidal::Locator.new(GlobalID.parse(gid)).locate From 27111ec8f4fbd8ea8ac2af1e150708a3c2808452 Mon Sep 17 00:00:00 2001 From: Rolando Sierra Date: Fri, 30 Oct 2026 08:54:35 -0600 Subject: [PATCH 4/4] Pin json below 3 for Ruby 3.2 CI json 3 rejects the quirks_mode option ActiveSupport passes to JSON.generate, which fails the global id spec on Ruby 3.2. Co-Authored-By: Claude Sonnet 5.5 --- mongoidal.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mongoidal.gemspec b/mongoidal.gemspec index d0d05d6..99879dc 100644 --- a/mongoidal.gemspec +++ b/mongoidal.gemspec @@ -21,6 +21,8 @@ Gem::Specification.new do |spec| spec.add_development_dependency "mongoid", ">= 7.4", "< 8.2" spec.add_development_dependency "sidekiq" spec.add_development_dependency "globalid" + # json 3 rejects the quirks_mode option that ActiveSupport 7.x passes to JSON.generate + spec.add_development_dependency "json", "< 3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" spec.add_development_dependency "rspec-its"