From 678ea0bef2402bc47124ed8a29d8bdbf35919374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Tue, 27 Feb 2018 17:43:00 +0100 Subject: [PATCH] Added unfeasible investments with valuation not finished to `UserSegments#feasible_and_undecided_investment_authors` --- lib/user_segments.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/user_segments.rb b/lib/user_segments.rb index e922c2321..1505e08e7 100644 --- a/lib/user_segments.rb +++ b/lib/user_segments.rb @@ -24,8 +24,9 @@ class UserSegments end def self.feasible_and_undecided_investment_authors - feasibility = %w(feasible undecided) - author_ids(current_budget_investments.where(feasibility: feasibility).pluck(:author_id).uniq) + unfeasible_and_finished_condition = "feasibility = 'unfeasible' and valuation_finished = true" + investments = current_budget_investments.where.not(unfeasible_and_finished_condition) + author_ids(investments.pluck(:author_id).uniq) end def self.selected_investment_authors