about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/account.rb8
-rw-r--r--app/views/admin/accounts/show.html.haml10
2 files changed, 13 insertions, 5 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index b8927c51f..19f8ca365 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -74,6 +74,14 @@ class Account < ApplicationRecord
   scope :alphabetic, -> { order(domain: :asc, username: :asc) }
   scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') }
 
+  delegate :email,
+    :current_sign_in_ip,
+    :current_sign_in_at,
+    :confirmed?,
+    to: :user,
+    prefix: true,
+    allow_nil: true
+
   def follow!(other_account)
     active_relationships.where(target_account: other_account).first_or_create!(target_account: other_account)
   end
diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml
index 898f43c0b..0b3348960 100644
--- a/app/views/admin/accounts/show.html.haml
+++ b/app/views/admin/accounts/show.html.haml
@@ -16,15 +16,15 @@
     - if @account.local?
       %tr
         %th= t('admin.accounts.email')
-        %td= @account.user.email
+        %td= @account.user_email
       %tr
         %th= t('admin.accounts.most_recent_ip')
-        %td= @account.user.current_sign_in_ip
+        %td= @account.user_current_sign_in_ip
       %tr
         %th= t('admin.accounts.most_recent_activity')
         %td
-          - if @account.user.current_sign_in_at
-            = l @account.user.current_sign_in_at
+          - if @account.user_current_sign_in_at
+            = l @account.user_current_sign_in_at
           - else
             Never
     - else
@@ -78,7 +78,7 @@
     = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button'
 
   - if @account.local?
-    - unless @account.user.confirmed?
+    - unless @account.user_confirmed?
       = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button'
 
   - if @account.suspended?