Use where.not instead of where(NOT IN)
This way we simplify the code a bit and reduce our usage of raw SQL.
This commit is contained in:
@@ -158,7 +158,7 @@ class ProposalsController < ApplicationController
|
||||
.sort_by_confidence_score.limit(Setting["featured_proposals_number"])
|
||||
if @featured_proposals.present?
|
||||
set_featured_proposal_votes(@featured_proposals)
|
||||
@resources = @resources.where("proposals.id NOT IN (?)", @featured_proposals.map(&:id))
|
||||
@resources = @resources.where.not(id: @featured_proposals)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user