Commit 6d43308b authored by Robert Speicher's avatar Robert Speicher

Add `Gitlab::Themes.for_user`

parent d6a145d4
......@@ -51,6 +51,19 @@ module Gitlab
THEMES.each(&block)
end
# Get the Theme for the specified user, or the default
#
# user - User record
#
# Returns a Theme
def self.for_user(user)
if user
by_id(user.theme_id)
else
default
end
end
private
def self.default_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment