Add new user segment all_proposals_authors

This commit is contained in:
decabeza
2019-05-17 17:22:29 +02:00
parent 525eb9034c
commit e6af2f15fb
4 changed files with 31 additions and 2 deletions

View File

@@ -1,12 +1,13 @@
class UserSegments
SEGMENTS = %w(all_users
SEGMENTS = %w[all_users
administrators
all_proposal_authors
proposal_authors
investment_authors
feasible_and_undecided_investment_authors
selected_investment_authors
winner_investment_authors
not_supported_on_current_budget)
not_supported_on_current_budget]
def self.all_users
User.active
@@ -16,6 +17,10 @@ class UserSegments
all_users.administrators
end
def self.all_proposal_authors
author_ids(Proposal.pluck(:author_id).uniq)
end
def self.proposal_authors
author_ids(Proposal.not_archived.not_retired.pluck(:author_id).uniq)
end