diff --git a/lib/user_segments.rb b/lib/user_segments.rb index 8a50f6d31..dd26132d0 100644 --- a/lib/user_segments.rb +++ b/lib/user_segments.rb @@ -11,30 +11,24 @@ class UserSegments end def self.proposal_authors - author_ids = Proposal.not_archived.not_retired.pluck(:author_id).uniq - author_ids(author_ids) + author_ids(Proposal.not_archived.not_retired.pluck(:author_id).uniq) end def self.investment_authors - author_ids = current_budget_investments.pluck(:author_id).uniq - author_ids(author_ids) + author_ids(current_budget_investments.pluck(:author_id).uniq) end def self.feasible_and_undecided_investment_authors - author_ids = current_budget_investments.where(feasibility: %w(feasible undecided)) - .pluck(:author_id).uniq - - author_ids(author_ids) + feasibility = %w(feasible undecided) + author_ids(current_budget_investments.where(feasibility: feasibility).pluck(:author_id).uniq) end def self.selected_investment_authors - author_ids = current_budget_investments.selected.pluck(:author_id).uniq - author_ids(author_ids) + author_ids(current_budget_investments.selected.pluck(:author_id).uniq) end def self.winner_investment_authors - author_ids = current_budget_investments.winners.pluck(:author_id).uniq - author_ids(author_ids) + author_ids(current_budget_investments.winners.pluck(:author_id).uniq) end private