From 12c6b8f125f4963e1724efc0859c1c81f5db1aac Mon Sep 17 00:00:00 2001 From: Nahuel Cuesta Luengo Date: Sat, 28 Mar 2015 19:33:56 -0300 Subject: [PATCH 1/2] Fix erroneous reference to AR class 9e818cde introduced a bug by making an erroneous reference to `ActiveRecord::Associations::JoinDependency` in line 187. As this class lives inside an `ActiveRecord` module, that reference needs to be absolute in order to properly point at AR's class. --- lib/ransack/adapters/active_record/context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ransack/adapters/active_record/context.rb b/lib/ransack/adapters/active_record/context.rb index f277a94..18f0dec 100644 --- a/lib/ransack/adapters/active_record/context.rb +++ b/lib/ransack/adapters/active_record/context.rb @@ -184,7 +184,7 @@ module Ransack :string_join when Hash, Symbol, Array :association_join - when ActiveRecord::Associations::JoinDependency + when ::ActiveRecord::Associations::JoinDependency :stashed_join when Arel::Nodes::Join :join_node From 631d104d6e8abee8888632109355c195f4c37111 Mon Sep 17 00:00:00 2001 From: Nahuel Cuesta Luengo Date: Mon, 30 Mar 2015 08:42:58 -0300 Subject: [PATCH 2/2] Updated AR-specific reference to use Polyamorous Changed reference from a version-dependent AR class to a better, more reliable Polyamorous one --- lib/ransack/adapters/active_record/context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ransack/adapters/active_record/context.rb b/lib/ransack/adapters/active_record/context.rb index 18f0dec..86ff423 100644 --- a/lib/ransack/adapters/active_record/context.rb +++ b/lib/ransack/adapters/active_record/context.rb @@ -184,7 +184,7 @@ module Ransack :string_join when Hash, Symbol, Array :association_join - when ::ActiveRecord::Associations::JoinDependency + when Polyamorous::JoinDependency, Polyamorous::JoinAssociation :stashed_join when Arel::Nodes::Join :join_node