]> cat aescling's git repositories - mastodon.git/blobdiff - app/models/status.rb
Include preview cards in status entity in REST API (#9120)
[mastodon.git] / app / models / status.rb
index bcb7dd373f4ade6daca05f3c8b28090fac9fb71f..cb2c010407778324031a7297e7c073da76e2b518 100644 (file)
@@ -89,6 +89,7 @@ class Status < ApplicationRecord
                    :conversation,
                    :status_stat,
                    :tags,
+                   :preview_cards,
                    :stream_entry,
                    active_mentions: :account,
                    reblog: [
@@ -96,6 +97,7 @@ class Status < ApplicationRecord
                      :application,
                      :stream_entry,
                      :tags,
+                     :preview_cards,
                      :media_attachments,
                      :conversation,
                      :status_stat,
@@ -163,6 +165,10 @@ class Status < ApplicationRecord
     reblog
   end
 
+  def preview_card
+    preview_cards.first
+  end
+
   def title
     if destroyed?
       "#{account.acct} deleted status"
This page took 0.029028 seconds and 3 git commands to generate.