about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2020-12-09 14:42:33 +0100
committerClaire <claire.github-309c@sitedethib.com>2020-12-09 14:42:33 +0100
commita16175645dd9e2abbdf72b5e396fa4c4a74e0ff9 (patch)
tree2d2d401791d9cab06f3285c7d3172f2223acfee2 /app/models
parent25f725d67a6d2542cd586ab7c56baca572eb4f88 (diff)
parent127c543a6e59d20de68e6760e952d18ed53578e9 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb2
-rw-r--r--app/models/form/account_batch.rb2
-rw-r--r--app/models/list.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 87b89df51..b70978d2b 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -445,7 +445,7 @@ class Account < ApplicationRecord
     end
 
     def inboxes
-      urls = reorder(nil).where(protocol: :activitypub).pluck(Arel.sql("distinct coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url)"))
+      urls = reorder(nil).where(protocol: :activitypub).group(:preferred_inbox_url).pluck(Arel.sql("coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url) AS preferred_inbox_url"))
       DeliveryFailureTracker.without_unavailable(urls)
     end
 
diff --git a/app/models/form/account_batch.rb b/app/models/form/account_batch.rb
index 882770d7c..26d6d3abf 100644
--- a/app/models/form/account_batch.rb
+++ b/app/models/form/account_batch.rb
@@ -51,7 +51,7 @@ class Form::AccountBatch
   end
 
   def account_domains
-    accounts.pluck(Arel.sql('distinct domain')).compact
+    accounts.group(:domain).pluck(:domain).compact
   end
 
   def accounts
diff --git a/app/models/list.rb b/app/models/list.rb
index 8493046e5..655d55ff6 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -8,7 +8,7 @@
 #  title          :string           default(""), not null
 #  created_at     :datetime         not null
 #  updated_at     :datetime         not null
-#  replies_policy :integer          default("list_replies"), not null
+#  replies_policy :integer          default("list"), not null
 #
 
 class List < ApplicationRecord
@@ -16,7 +16,7 @@ class List < ApplicationRecord
 
   PER_ACCOUNT_LIMIT = 50
 
-  enum replies_policy: [:list_replies, :all_replies, :no_replies], _prefix: :show
+  enum replies_policy: [:list, :followed, :none], _prefix: :show
 
   belongs_to :account, optional: true