From 112b6843447ef812e6504ef84e26a6969a84d205 Mon Sep 17 00:00:00 2001 From: Yunzheng <42thcoder@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:02:11 +0800 Subject: [PATCH] fix wrong require If the ActiveRecord version is 7.1.3.4, it will lead to the loading of the join_association_7_2 module, which will then cause a similar NoMethodError: undefined method 'with_connection' for class Ignore error. --- lib/polyamorous/polyamorous.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/polyamorous/polyamorous.rb b/lib/polyamorous/polyamorous.rb index 9e558709..f1b759d2 100644 --- a/lib/polyamorous/polyamorous.rb +++ b/lib/polyamorous/polyamorous.rb @@ -15,7 +15,7 @@ module Polyamorous require 'polyamorous/activerecord/join_dependency' require 'polyamorous/activerecord/reflection' - if ::ActiveRecord.version > ::Gem::Version.new("7.1") + if ::ActiveRecord.version >= ::Gem::Version.new("7.2") require "polyamorous/activerecord/join_association_7_2" end