Anon user name
This commit is contained in:
parent
a1d8e6bdcd
commit
2d2c19800b
@ -82,7 +82,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def display_name
|
def display_name
|
||||||
self.email.split("@")[0] || "Guest#{self.soft_token[0..5]}"
|
principal[0..4]
|
||||||
end
|
end
|
||||||
|
|
||||||
def sit_in(seat)
|
def sit_in(seat)
|
||||||
|
|||||||
@ -16,7 +16,9 @@ class UserPolicy
|
|||||||
if user.admin?
|
if user.admin?
|
||||||
scope.all
|
scope.all
|
||||||
else
|
else
|
||||||
scope.where(role: User.roles[:admin])
|
scope.all
|
||||||
|
# scope.where(role: User.roles[:admin])
|
||||||
|
# scope.all.where(id: @user.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,11 @@
|
|||||||
%section.stats
|
%section.stats
|
||||||
= render 'shared/stats'
|
= render 'shared/stats'
|
||||||
|
|
||||||
|
- if @feed_items.any?
|
||||||
|
.contain
|
||||||
|
%h2 Post feed
|
||||||
|
= render 'shared/feed'
|
||||||
|
|
||||||
- if @user.microposts.any?
|
- if @user.microposts.any?
|
||||||
%section.microposts
|
%section.microposts
|
||||||
%h2 My Posts #{@user.microposts.count}
|
%h2 My Posts #{@user.microposts.count}
|
||||||
@ -14,7 +19,3 @@
|
|||||||
= render @microposts
|
= render @microposts
|
||||||
= will_paginate @microposts
|
= will_paginate @microposts
|
||||||
|
|
||||||
- if @feed_items.any?
|
|
||||||
.contain
|
|
||||||
%h2 Post feed
|
|
||||||
= render 'shared/feed'
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user