about summary refs log tree commit diff
path: root/app/models/announcement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/announcement.rb')
-rw-r--r--app/models/announcement.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/announcement.rb b/app/models/announcement.rb
index d99502f44..a4e427b49 100644
--- a/app/models/announcement.rb
+++ b/app/models/announcement.rb
@@ -14,6 +14,7 @@
 #  created_at   :datetime         not null
 #  updated_at   :datetime         not null
 #  published_at :datetime
+#  status_ids   :bigint           is an Array
 #
 
 class Announcement < ApplicationRecord
@@ -48,6 +49,16 @@ class Announcement < ApplicationRecord
     @mentions ||= Account.from_text(text)
   end
 
+  def statuses
+    @statuses ||= begin
+      if status_ids.nil?
+        []
+      else
+        Status.where(id: status_ids, visibility: [:public, :unlisted])
+      end
+    end
+  end
+
   def tags
     @tags ||= Tag.find_or_create_by_names(Extractor.extract_hashtags(text))
   end