about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-09 09:56:53 +0200
committerGitHub <noreply@github.com>2018-08-09 09:56:53 +0200
commitf2404de871f0bdfda5c9aeeeb4c6c4d10a8da8ab (patch)
treef45577d1fe26ea56f7323b940f506f8875d7344e /app/models/account.rb
parent80176a3814abad7f5c9023f97b5d4d82b73c089d (diff)
Public profile endorsements (accounts picked by profile owner) (#8146)
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 0272b4615..c33ec4bd5 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -89,6 +89,10 @@ class Account < ApplicationRecord
   has_many :status_pins, inverse_of: :account, dependent: :destroy
   has_many :pinned_statuses, -> { reorder('status_pins.created_at DESC') }, through: :status_pins, class_name: 'Status', source: :status
 
+  # Endorsements
+  has_many :account_pins, inverse_of: :account, dependent: :destroy
+  has_many :endorsed_accounts, through: :account_pins, class_name: 'Account', source: :target_account
+
   # Media
   has_many :media_attachments, dependent: :destroy