diff --git a/Gemfile b/Gemfile index 7dd4b17..b409724 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gemspec gem 'bundler' gem 'rake' gem 'pry-byebug' -gem 'mongoid', '~> 8' +gem 'mongoid', '~> 9' group :test do gem 'rspec-given', '~> 3.5' diff --git a/Gemfile.lock b/Gemfile.lock index a494ebf..00b3f20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,68 +2,77 @@ PATH remote: . specs: mongoid_includes (3.0.2) - mongoid (>= 7.0.10, < 9.0.0) + mongoid (>= 7.0.10, < 10.0.0) GEM remote: https://rubygems.org/ specs: - activemodel (7.0.4) - activesupport (= 7.0.4) - activesupport (7.0.4) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - bson (4.15.0) + base64 (0.2.0) + bigdecimal (3.1.8) + bson (5.0.1) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.1.10) - diff-lcs (1.4.4) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + diff-lcs (1.5.1) docile (1.3.2) - given_core (3.8.1) + drb (2.2.1) + given_core (3.8.2) sorcerer (>= 0.3.7) - i18n (1.12.0) + i18n (1.14.5) concurrent-ruby (~> 1.0) json (2.3.1) - method_source (1.0.0) - minitest (5.16.3) - mongo (2.18.1) - bson (>= 4.14.1, < 5.0.0) - mongoid (8.0.2) - activemodel (>= 5.1, < 7.1, != 7.0.0) + method_source (1.1.0) + minitest (5.24.1) + mongo (2.20.1) + bson (>= 4.14.1, < 6.0.0) + mongoid (9.0.1) + activemodel (>= 5.1, < 7.2, != 7.0.0) + concurrent-ruby (>= 1.0.5, < 2.0) mongo (>= 2.18.0, < 3.0.0) - ruby2_keywords (~> 0.0.5) - pry (0.13.1) + mutex_m (0.2.0) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.9.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.13.0) + pry (>= 0.13, < 0.15) rake (13.0.1) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-given (3.8.1) - given_core (= 3.8.1) + rspec-support (~> 3.13.0) + rspec-given (3.8.2) + given_core (= 3.8.2) rspec (>= 2.14.0) - rspec-mocks (3.9.1) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.4) - ruby2_keywords (0.0.5) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) sorcerer (2.0.1) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) PLATFORMS @@ -71,7 +80,7 @@ PLATFORMS DEPENDENCIES bundler - mongoid (~> 8) + mongoid (~> 9) mongoid_includes! pry-byebug rake diff --git a/lib/mongoid_includes.rb b/lib/mongoid_includes.rb index bcf12ce..fb8f90f 100644 --- a/lib/mongoid_includes.rb +++ b/lib/mongoid_includes.rb @@ -9,4 +9,8 @@ Mongoid::Contextual::Memory.send :prepend, Mongoid::Includes::EagerLoad Mongoid::Criteria.send :prepend, Mongoid::Includes::Criteria -Mongoid::Association::Referenced::Eager::Base.send :prepend, Mongoid::Includes::Association::Eager +if defined?(Mongoid::Association::Referenced::Eager::Base) + Mongoid::Association::Referenced::Eager::Base.send :prepend, Mongoid::Includes::Association::Eager +else + Mongoid::Association::Eager.send :prepend, Mongoid::Includes::Association::Eager +end diff --git a/mongoid_includes.gemspec b/mongoid_includes.gemspec index 9ac838b..12091d4 100644 --- a/mongoid_includes.gemspec +++ b/mongoid_includes.gemspec @@ -22,5 +22,5 @@ Gem::Specification.new do |s| s.files = Dir.glob('lib/**/*') + %w(CHANGELOG.md LICENSE.txt README.md Rakefile) s.test_files = Dir.glob('spec/**/*') - s.add_runtime_dependency 'mongoid', ['>= 7.0.10', '< 9.0.0'] + s.add_runtime_dependency 'mongoid', ['>= 7.0.10', '< 10.0.0'] end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a7c7b33..55c51d9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -54,3 +54,5 @@ def log_mongo_to_console Mongoid.purge! end end + +Time.zone = 'UTC'