CurrentUser: remove #as method.
Replace with CurrentUser#scoped.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user