From 4f24dc31dc58cedc3820baf258112e9bed2b3e69 Mon Sep 17 00:00:00 2001
From: ThibG <thib@sitedethib.com>
Date: Wed, 15 Aug 2018 20:23:12 +0200
Subject: [PATCH] Fix FixAccountsUniqueIndex migration (#8212)

---
 db/migrate/20180528141303_fix_accounts_unique_index.rb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/db/migrate/20180528141303_fix_accounts_unique_index.rb b/db/migrate/20180528141303_fix_accounts_unique_index.rb
index 624ea229e4..bd4e158b7e 100644
--- a/db/migrate/20180528141303_fix_accounts_unique_index.rb
+++ b/db/migrate/20180528141303_fix_accounts_unique_index.rb
@@ -6,6 +6,10 @@ class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
     def local?
       domain.nil?
     end
+
+    def acct
+      local? ? username : "#{username}@#{domain}"
+    end
   end
 
   disable_ddl_transaction!
-- 
GitLab