diff options
author | ThibG <thib@sitedethib.com> | 2019-01-11 10:53:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 10:53:58 +0100 |
commit | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (patch) | |
tree | c57169b5a3d717f4e68b8ec5d2d6e220d1456434 /app/models/concerns | |
parent | d1da0a1086fa25f22739277fbf32ba1b3745317d (diff) | |
parent | 394525e32994e605093c87d3a9fad2a4202f3401 (diff) |
Merge pull request #885 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/account_associations.rb | 1 | ||||
-rw-r--r-- | app/models/concerns/account_finder_concern.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/models/concerns/account_associations.rb b/app/models/concerns/account_associations.rb index de7f3d525..4e730451a 100644 --- a/app/models/concerns/account_associations.rb +++ b/app/models/concerns/account_associations.rb @@ -15,6 +15,7 @@ module AccountAssociations has_many :mentions, inverse_of: :account, dependent: :destroy has_many :notifications, inverse_of: :account, dependent: :destroy has_many :conversations, class_name: 'AccountConversation', dependent: :destroy, inverse_of: :account + has_many :scheduled_statuses, inverse_of: :account, dependent: :destroy # Pinned statuses has_many :status_pins, inverse_of: :account, dependent: :destroy diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb index 6b7237e89..7e3bbde09 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account_finder_concern.rb @@ -12,6 +12,10 @@ module AccountFinderConcern find_remote(username, domain) || raise(ActiveRecord::RecordNotFound) end + def representative + find_local(Setting.site_contact_username.gsub(/\A@/, '')) || Account.local.find_by(suspended: false) + end + def find_local(username) find_remote(username, nil) end |