Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Fixed build_join_dependency to handle Squeel's join nodes. #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/meta_search/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -296,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)
Expand Down