0
0
Fork 0

Change private statuses index to index without crutches (#26713)

This commit is contained in:
Claire 2023-08-29 17:51:13 +02:00 committed by GitHub
parent 74eb7dbf2d
commit 9e77ab7db2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 47 deletions

View file

@ -28,6 +28,7 @@ class Poll < ApplicationRecord
has_many :votes, class_name: 'PollVote', inverse_of: :poll, dependent: :delete_all
has_many :voters, -> { group('accounts.id') }, through: :votes, class_name: 'Account', source: :account
has_many :local_voters, -> { group('accounts.id').merge(Account.local) }, through: :votes, class_name: 'Account', source: :account
has_many :notifications, as: :activity, dependent: :destroy