From 847f732eae8f05566787e68dfeac52399ea6badb Mon Sep 17 00:00:00 2001 From: Gilson Mendes Date: Fri, 17 Nov 2023 09:31:32 -0300 Subject: [PATCH] Adding support to mongoid 7.3.5 --- Gemfile | 2 +- README.md | 3 ++- gemfiles/Mongoid_7.gemfile | 2 +- lib/mongoid/core_ext/association/embedded/batchable.rb | 2 +- lib/mongoid/versioning/version.rb | 2 +- mongoid-versioning.gemspec | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 2af579f..4182c03 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' gemspec -gem 'mongoid' +gem 'mongoid', "~> 7.3.5" diff --git a/README.md b/README.md index 934caf7..d7baa83 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ This fork has additional changes to support the following mongoid/ruby versions: |-----------------|-----------------------------------------------------------------------------------|--------------------------|------------------------|-------| | mongoid <5 | [master](https://github.com/fullhealthmedical/mongoid-versioning/tree/master) | Yes | 2.5, 2.6 | ![Build](https://github.com/fullhealthmedical/mongoid-versioning/actions/workflows/build.yml/badge.svg?branch=master) | | mongoid 6 | [mongoid6](https://github.com/fullhealthmedical/mongoid-versioning/tree/mongoid6) | No | 2.7 | ![Build](https://github.com/fullhealthmedical/mongoid-versioning/actions/workflows/build.yml/badge.svg?branch=mongoid6) | -| mongoid >= 7.0 | [mongoid7](https://github.com/fullhealthmedical/mongoid-versioning/tree/mongoid7) | No | 2.7 | ![Build](https://github.com/fullhealthmedical/mongoid-versioning/actions/workflows/build.yml/badge.svg?branch=mongoid7) | +| mongoid >= 7.0 < 7.3.5 | [mongoid7](https://github.com/fullhealthmedical/mongoid-versioning/tree/mongoid7) | No | 2.7 | ![Build](https://github.com/fullhealthmedical/mongoid-versioning/actions/workflows/build.yml/badge.svg?branch=mongoid7) | +| mongoid >= 7.0 < 7.3.5 | [mongoid7](https://github.com/fullhealthmedical/mongoid-versioning/tree/mongoid73) | No | 2.7 | ![Build](https://github.com/fullhealthmedical/mongoid-versioning/actions/workflows/build.yml/badge.svg?branch=mongoid73) | In your Gemfile: diff --git a/gemfiles/Mongoid_7.gemfile b/gemfiles/Mongoid_7.gemfile index 02acc83..7612014 100644 --- a/gemfiles/Mongoid_7.gemfile +++ b/gemfiles/Mongoid_7.gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' gemspec path: '../' -gem 'mongoid', '~> 7.0' +gem 'mongoid', '~> 7.3.5' diff --git a/lib/mongoid/core_ext/association/embedded/batchable.rb b/lib/mongoid/core_ext/association/embedded/batchable.rb index 8a97a0a..a905d02 100755 --- a/lib/mongoid/core_ext/association/embedded/batchable.rb +++ b/lib/mongoid/core_ext/association/embedded/batchable.rb @@ -20,7 +20,7 @@ def pre_process_batch_remove(docs, method) self.path = doc.atomic_path unless path execute_callback :before_remove, doc if !_assigning? && !association.versioned? - doc.apply_delete_dependencies! + doc.apply_destroy_dependencies! doc.run_before_callbacks(:destroy) if method == :destroy end _target.delete_one(doc) diff --git a/lib/mongoid/versioning/version.rb b/lib/mongoid/versioning/version.rb index 9551128..cd40d92 100644 --- a/lib/mongoid/versioning/version.rb +++ b/lib/mongoid/versioning/version.rb @@ -1,5 +1,5 @@ module Mongoid module Versioning - VERSION = '2.1.0'.freeze + VERSION = '3.0.0'.freeze end end diff --git a/mongoid-versioning.gemspec b/mongoid-versioning.gemspec index cbf9903..c0462fb 100644 --- a/mongoid-versioning.gemspec +++ b/mongoid-versioning.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |gem| gem.require_path = 'lib' gem.add_dependency 'activesupport', '>= 4.0' - gem.add_dependency 'mongoid', '>= 7.0.0', '< 7.3' + gem.add_dependency 'mongoid', '~> 7.3.5' gem.add_development_dependency 'rake', '~> 10.0' gem.add_development_dependency 'rspec', '~> 3' end