Handle joins with having #5

Open
bilal.catic wants to merge 17 commits from handle-joins-with-having into master
Showing only changes of commit 15fc342633 - Show all commits

View File

@@ -63,7 +63,7 @@ module PgSearchable
@ts_joins
)
sql_query = select(:id).distinct.joins(sql_query_object.join_clause).group(:id).having(sql_query_object.where_clause)
modified_sql_query = sql_query.to_sql.gsub('INNER', 'LEFT OUTER') # TODO: Search terms should not be replaced!
modified_sql_query = sql_query.to_sql.gsub('INNER', 'LEFT OUTER')
ActiveRecord::Base.connection.exec_query(modified_sql_query)
end