about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-15 20:23:12 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-08-15 20:23:12 +0200
commit4f24dc31dc58cedc3820baf258112e9bed2b3e69 (patch)
treeccad31d72d980180861f245eb11b0f28d99e5de9
parent625b5a567bb94a557572176357cd2381ac17a06d (diff)
Fix FixAccountsUniqueIndex migration (#8212)
-rw-r--r--db/migrate/20180528141303_fix_accounts_unique_index.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/db/migrate/20180528141303_fix_accounts_unique_index.rb b/db/migrate/20180528141303_fix_accounts_unique_index.rb
index 624ea229e..bd4e158b7 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!