diff options
author | pluralcafe-docker <git@plural.cafe> | 2019-01-12 04:24:01 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2019-01-12 04:24:01 +0000 |
commit | a6e0ff72f552dc172c18f5a10bbca071b067ab51 (patch) | |
tree | f845d5a7e328c3babfde43066325262c1dbdbed0 /app/models/concerns | |
parent | 74134e490c49d8a7d88cc69720e22cd88cee9233 (diff) | |
parent | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff) |
Merge branch 'glitch' into production
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 |