add shortcut for currentuser.admin

This commit is contained in:
r888888888
2014-06-11 17:47:07 -07:00
parent e64dac0b5d
commit 9aa1f65eb5

View File

@@ -15,6 +15,10 @@ class CurrentUser
end
end
def self.as_admin(&block)
scoped(User.admins.first, "127.0.0.1", &block)
end
def self.user=(user)
Thread.current[:current_user] = user
end