Skip to content

Commit

Permalink
Concat primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
causztic committed Jul 24, 2024
1 parent 2e70205 commit ccc2e82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/pg_search/scope_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ def order_within_rank
end

def primary_key
"#{quoted_table_name}.#{connection.quote_column_name(model.primary_key)}"
if model.primary_key.is_a?(Array)
model.primary_key.map { |part| "#{quoted_table_name}.#{connection.quote_column_name(part)}" }
.join(',')
else
"#{quoted_table_name}.#{connection.quote_column_name(model.primary_key)}"
end
end

def subquery_join
Expand Down

0 comments on commit ccc2e82

Please sign in to comment.