Anon user name
This commit is contained in:
parent
92fbc9d67c
commit
5560167aa3
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user