From 0b250d98aeae751504fdd6397290cc392c3ee350 Mon Sep 17 00:00:00 2001 From: Nicolas Buduroi Date: Sat, 3 Dec 2011 17:07:09 -0500 Subject: [PATCH 1/2] Fixed build_join_dependency to handle Squeel's join nodes. --- lib/meta_search/builder.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/meta_search/builder.rb b/lib/meta_search/builder.rb index 024a080..c990cc2 100644 --- a/lib/meta_search/builder.rb +++ b/lib/meta_search/builder.rb @@ -275,6 +275,8 @@ def build_join_dependency(relation) 'stashed_join' when Arel::Nodes::Join 'join_node' + when Squeel::Nodes::Join + 'join_node' else raise 'unknown class: %s' % join.class.name end From f86e2501f6fe9126f9a6e427df854593080b562b Mon Sep 17 00:00:00 2001 From: Nicolas Buduroi Date: Sat, 3 Dec 2011 17:11:44 -0500 Subject: [PATCH 2/2] Fixed build_join_dependency by making sure a string is sent to aliased_name_for. --- lib/meta_search/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/meta_search/builder.rb b/lib/meta_search/builder.rb index c990cc2..d72ea8b 100644 --- a/lib/meta_search/builder.rb +++ b/lib/meta_search/builder.rb @@ -298,7 +298,7 @@ def build_join_dependency(relation) ) join_nodes.each do |join| - join_dependency.alias_tracker.aliased_name_for(join.left.name.downcase) + join_dependency.alias_tracker.aliased_name_for(join.left.name.downcase.to_s) end join_dependency.graft(*stashed_association_joins)