diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 20:23:08 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 20:23:08 +0300 |
commit | 9e613b91d6711ed46f287ac619e021f4c88d366a (patch) | |
tree | 67683a33138bb5bca8dfa1162489f17e2ae006d3 /lib | |
parent | c29857ac00572485e47c9ad0a3740f7f2a0f89b6 (diff) | |
parent | 3c439888a6a080ffaa26a0edc7291d25eaa26791 (diff) | |
download | gitlab-ce-9e613b91d6711ed46f287ac619e021f4c88d366a.tar.gz |
Merge pull request #7318 from jvanbaarsen/constant-warning-fix
Removed some constant allready defined warnings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/theme.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/visibility_level.rb | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/gitlab/theme.rb b/lib/gitlab/theme.rb index 44237a062fc..b7c50cb734d 100644 --- a/lib/gitlab/theme.rb +++ b/lib/gitlab/theme.rb @@ -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 = { diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index eada9bcddf5..ea1319268f8 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -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 |