Merge branch 'rails-5.1'

This commit is contained in:
Albert Yi
2018-04-11 11:40:36 -07:00
361 changed files with 4795 additions and 4798 deletions

View File

@@ -14,6 +14,10 @@ class CurrentUser
end
end
def self.as(user, &block)
scoped(user, &block)
end
def self.as_admin(&block)
if block_given?
scoped(User.admins.first, "127.0.0.1", &block)
@@ -91,10 +95,6 @@ class CurrentUser
end
def self.method_missing(method, *params, &block)
if user.respond_to?(method)
user.__send__(method, *params, &block)
else
super
end
user.__send__(method, *params, &block)
end
end