From a7ce3b78f6b1f9c39a429986cfb55e7fce4fdae1 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 20 Sep 2020 02:17:10 -0500 Subject: [Models] Add site_contact convenience method to AccountFinder --- app/models/concerns/account_finder_concern.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb index 04b2c981b..c414a6d87 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account_finder_concern.rb @@ -16,6 +16,10 @@ module AccountFinderConcern Account.find(-99) end + def site_contact + Account.find_local(Setting.site_contact_username.strip.gsub(/\A@/, '')).presence || representative + end + def find_local(username) find_remote(username, nil) end -- cgit