Added unfeasible investments with valuation not finished to UserSegments#feasible_and_undecided_investment_authors

This commit is contained in:
María Checa
2018-02-27 17:43:00 +01:00
parent c2e9096ce1
commit 678ea0bef2

View File

@@ -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