Skip to content

Commit

Permalink
Ignore polymorphic joins when trying to be consistent with the condit…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
binarylogic committed Sep 14, 2009
1 parent 8a60547 commit 4d619e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/searchlogic/active_record/consistency.rb
Expand Up @@ -17,7 +17,7 @@ def merge_joins_with_searchlogic(*args)
joins = merge_joins_without_searchlogic(*args)
joins = joins.collect { |j| j.is_a?(String) ? j.split(" ") : j }.flatten.uniq
joins = joins.collect do |j|
if j.is_a?(String)
if j.is_a?(String) && !j =~ / (AND|OR) /i
j.gsub(/(.*) ON (.*) = (.*)/) do |m|
sorted = [$2,$3].sort
"#{$1} ON #{sorted[0]} = #{sorted[1]}"
Expand Down

0 comments on commit 4d619e8

Please sign in to comment.