Removed some constant allready defined warnings

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
This commit is contained in:
Jeroen van Baarsen 2014-07-16 20:12:46 +02:00
parent de582ab375
commit 3c439888a6
2 changed files with 9 additions and 9 deletions

View File

@ -1,10 +1,10 @@
module Gitlab
class Theme
BASIC = 1
MARS = 2
MODERN = 3
GRAY = 4
COLOR = 5
BASIC = 1 unless const_defined?(:BASIC)
MARS = 2 unless const_defined?(:MARS)
MODERN = 3 unless const_defined?(:MODERN)
GRAY = 4 unless const_defined?(:GRAY)
COLOR = 5 unless const_defined?(:COLOR)
def self.css_class_by_id(id)
themes = {

View File

@ -5,9 +5,9 @@
#
module Gitlab
module VisibilityLevel
PRIVATE = 0
INTERNAL = 10
PUBLIC = 20
PRIVATE = 0 unless const_defined?(:PRIVATE)
INTERNAL = 10 unless const_defined?(:INTERNAL)
PUBLIC = 20 unless const_defined?(:PUBLIC)
class << self
def values
@ -21,7 +21,7 @@ module Gitlab
'Public' => PUBLIC
}
end
def allowed_for?(user, level)
user.is_admin? || !Gitlab.config.gitlab.restricted_visibility_levels.include?(level)
end