Skip to content

Commit

Permalink
cleaning up custom_join_sql method
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Dec 7, 2010
1 parent 7c92063 commit 70ab450
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions activerecord/lib/active_record/relation/query_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ def arel
end

def custom_join_sql(joins)
arel = table.select_manager
joins = joins.reject { |join| join.blank? }

joins.each do |join|
next if join.blank?
return if joins.empty?

@implicit_readonly = true
@implicit_readonly = true

arel = table.select_manager

joins.each do |join|
case join
when Array
join = Arel.sql(join.join(' ')) if array_of_strings?(join)
Expand Down

0 comments on commit 70ab450

Please sign in to comment.