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:
@@ -45,10 +45,9 @@ class UserSegments
|
||||
|
||||
def self.not_supported_on_current_budget
|
||||
author_ids(
|
||||
User.where(
|
||||
"id NOT IN (?)",
|
||||
Vote.select(:voter_id).where(votable: current_budget_investments).distinct
|
||||
)
|
||||
User.where.not(
|
||||
id: Vote.select(:voter_id).where(votable: current_budget_investments).distinct
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user