Skip to content

Commit

Permalink
Merge pull request #764 from syndbg/rails-5-fix
Browse files Browse the repository at this point in the history
Fix left_outer_joins not being respected
  • Loading branch information
scarroll32 authored Feb 7, 2018
2 parents 30bbef4 + 4e43a99 commit 14f7f93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ransack/adapters/active_record/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def join_dependency(relation)
# Checkout active_record/relation/query_methods.rb +build_joins+ for
# reference. Lots of duplicated code maybe we can avoid it
def build_joins(relation)
buckets = relation.joins_values.group_by do |join|
buckets = relation.joins_values
buckets += relation.left_outer_joins_values if ::ActiveRecord::VERSION::MAJOR >= 5

buckets = buckets.group_by do |join|
case join
when String
:string_join
Expand Down

0 comments on commit 14f7f93

Please sign in to comment.