Anon user name

This commit is contained in:
TheNeedful-DO 2023-11-23 14:49:46 +00:00
parent 92fbc9d67c
commit 5560167aa3
3 changed files with 9 additions and 6 deletions

View File

@ -82,7 +82,7 @@ class User < ActiveRecord::Base
end
def display_name
self.email.split("@")[0] || "Guest#{self.soft_token[0..5]}"
principal[0..4]
end
def sit_in(seat)

View File

@ -16,7 +16,9 @@ class UserPolicy
if user.admin?
scope.all
else
scope.where(role: User.roles[:admin])
scope.all
# scope.where(role: User.roles[:admin])
# scope.all.where(id: @user.id)
end
end

View File

@ -7,6 +7,11 @@
%section.stats
= render 'shared/stats'
- if @feed_items.any?
.contain
%h2 Post feed
= render 'shared/feed'
- if @user.microposts.any?
%section.microposts
%h2 My Posts #{@user.microposts.count}
@ -14,7 +19,3 @@
= render @microposts
= will_paginate @microposts
- if @feed_items.any?
.contain
%h2 Post feed
= render 'shared/feed'