users: remove as_admin and as_current methods.

This commit is contained in:
evazion
2020-03-21 20:44:14 -05:00
parent 94d78287eb
commit b21e1d219c
4 changed files with 2 additions and 18 deletions

View File

@@ -24,15 +24,6 @@ class CurrentUser
scoped(user, &block)
end
def self.as_admin(&block)
if block_given?
scoped(::User.admins.first, "127.0.0.1", &block)
else
self.user = ::User.admins.first
self.ip_addr = "127.0.0.1"
end
end
def self.as_system(&block)
if block_given?
scoped(::User.system, "127.0.0.1", &block)

View File

@@ -680,10 +680,6 @@ class User < ApplicationRecord
include CountMethods
extend SearchMethods
def as_current(&block)
CurrentUser.as(self, &block)
end
def hide_favorites?
!CurrentUser.is_admin? && enable_private_favorites? && CurrentUser.user.id != id
end