CurrentUser: remove #as method.

Replace with CurrentUser#scoped.
This commit is contained in:
evazion
2021-06-22 23:39:30 -05:00
parent 7f0edc32dd
commit e5cfb7904c
11 changed files with 12 additions and 22 deletions

View File

@@ -10,14 +10,4 @@ class CurrentUser < ActiveSupport::CurrentAttributes
yield user
end
end
def self.as(user_or_id, &block)
if user_or_id.is_a?(String) || user_or_id.is_a?(Integer)
user = ::User.find(user_or_id)
else
user = user_or_id
end
scoped(user, &block)
end
end