@@ -107,7 +107,7 @@ def join_sources
107107 base , joins =
108108 if ::ActiveRecord ::VERSION ::STRING > Constants ::RAILS_5_2_0
109109 alias_tracker = ::ActiveRecord ::Associations ::AliasTracker . create ( self . klass . connection , @object . table . name , [ ] )
110- constraints = if ::ActiveRecord ::VERSION ::STRING >= Constants ::RAILS_6_0
110+ constraints = if ::Gem :: Version . new ( :: ActiveRecord ::VERSION ::STRING ) >= :: Gem :: Version . new ( Constants ::RAILS_6_0 )
111111 @join_dependency . join_constraints ( @object . joins_values , alias_tracker )
112112 else
113113 @join_dependency . join_constraints ( @object . joins_values , @join_type , alias_tracker )
@@ -281,7 +281,7 @@ def build_joins(relation)
281281 end
282282 else
283283 alias_tracker = ::ActiveRecord ::Associations ::AliasTracker . create ( self . klass . connection , relation . table . name , join_list )
284- join_dependency = if ::ActiveRecord ::VERSION ::STRING >= Constants ::RAILS_6_0
284+ join_dependency = if ::Gem :: Version . new ( :: ActiveRecord ::VERSION ::STRING ) >= :: Gem :: Version . new ( Constants ::RAILS_6_0 )
285285 Polyamorous ::JoinDependency . new ( relation . klass , relation . table , association_joins , Arel ::Nodes ::OuterJoin )
286286 else
287287 Polyamorous ::JoinDependency . new ( relation . klass , relation . table , association_joins )
@@ -313,15 +313,15 @@ def find_association(name, parent = @base, klass = nil)
313313 end
314314
315315 def build_association ( name , parent = @base , klass = nil )
316- if ::ActiveRecord ::VERSION ::STRING >= Constants ::RAILS_6_0
316+ if ::Gem :: Version . new ( :: ActiveRecord ::VERSION ::STRING ) >= :: Gem :: Version . new ( Constants ::RAILS_6_0 )
317317 jd = Polyamorous ::JoinDependency . new (
318318 parent . base_klass ,
319319 parent . table ,
320320 Polyamorous ::Join . new ( name , @join_type , klass ) ,
321321 @join_type
322322 )
323323 found_association = jd . instance_variable_get ( :@join_root ) . children . last
324- elsif ::ActiveRecord ::VERSION ::STRING < Constants ::RAILS_5_2_0
324+ elsif ::Gem :: Version . new ( :: ActiveRecord ::VERSION ::STRING ) < :: Gem :: Version . new ( Constants ::RAILS_5_2_0 )
325325 jd = Polyamorous ::JoinDependency . new (
326326 parent . base_klass ,
327327 Polyamorous ::Join . new ( name , @join_type , klass ) ,
0 commit comments