Add administrators UserSegment

We need a user segment to have only administrators as recipients of both
newsletters and notifications
This commit is contained in:
Bertocq
2018-02-21 19:03:11 +01:00
parent 4bf20e5bd9
commit 61f015e2c2
4 changed files with 19 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
class UserSegments
SEGMENTS = %w(all_users
administrators
proposal_authors
investment_authors
feasible_and_undecided_investment_authors
@@ -10,6 +11,10 @@ class UserSegments
User.active
end
def self.administrators
all_users.administrators
end
def self.proposal_authors
author_ids(Proposal.not_archived.not_retired.pluck(:author_id).uniq)
end