about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-11 15:28:06 +0200
committerGitHub <noreply@github.com>2018-08-11 15:28:06 +0200
commitd787bcdeb1570e4d8d67f326dadaf321a6854e06 (patch)
treefa23a187b16bf07635312a7791013aacfc2c4474 /app/models/account.rb
parent03afc365d530e6d57754ae9dbbdbd0c56431ee02 (diff)
parent7067b64de33f9cd491e97329df266fde5fb49e42 (diff)
Merge pull request #630 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
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 041eda6f4..9daf063a5 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -92,6 +92,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