about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-13 21:06:09 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-13 21:06:09 -0600
commit1fbe7c340201ddff5232c7931a265136943ffd59 (patch)
tree2e028e66c1236a66e3536ff290e385a9fe11056e /app/models
parentdfce98a69b0c6f9f08db327cc4fed6c75fd93dd0 (diff)
remove duplicates from media gallery mode, attempt 2
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index ccc7755be..001437795 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -122,7 +122,7 @@ class Status < ApplicationRecord
   scope :search_filtered_by_account, ->(account_id) { where("tsv @@ (SELECT tsquery_union(websearch_to_tsquery('fedi', phrase)) FROM custom_filters WHERE account_id = ? AND is_enabled)", account_id) }
   scope :search_not_filtered_by_account, ->(account_id) { where.not("tsv @@ (SELECT tsquery_union(websearch_to_tsquery('fedi', phrase)) FROM custom_filters WHERE account_id = ? AND is_enabled)", account_id) }
 
-  scope :with_media, -> { joins(:media_attachments).select('statuses.*').distinct(:id) }
+  scope :with_media, -> { joins(:media_attachments).select('statuses.*').distinct(:status_id) }
   scope :not_missing_media_desc, -> { left_outer_joins(:media_attachments).select('statuses.*').where('media_attachments.id IS NULL OR media_attachments.description IS NOT NULL') }
 
   scope :only_followers_of, ->(account) { where(account: [account] + account.following) }