Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-06-11 11:18:04 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-06-11 11:18:04 +0300
commit6050b348d72a82bd2373d45fbd33ac693cd80d42 (patch)
treeff1fd4b5ab2c83b2c3ed2d30e93ad9cf898f8ebd /app
parent338c7b31baba174971cead6843c847aabad2c1b2 (diff)
parent15ba85ab8e6c0f3dd18663233fd86bcb3bde4e73 (diff)
Merge branch 'dz-cleanup-deprecated-code' into 'master'
Remove some deprecated code See merge request gitlab-org/gitlab-ce!29222
Diffstat (limited to 'app')
-rw-r--r--app/finders/issuable_finder.rb8
-rw-r--r--app/models/broadcast_message.rb11
-rw-r--r--app/models/label.rb1
3 files changed, 3 insertions, 17 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 50e9418677c..3592505a977 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -43,7 +43,7 @@ class IssuableFinder
FILTER_NONE = 'none'.freeze
FILTER_ANY = 'any'.freeze
- # This is accepted as a deprecated filter and is also used in unassigning users
+ # This is used in unassigning users
NONE = '0'.freeze
attr_accessor :current_user, :params
@@ -248,8 +248,7 @@ class IssuableFinder
def filter_by_no_label?
downcased = label_names.map(&:downcase)
- # Label::NONE is deprecated and should be removed in 12.0
- downcased.include?(FILTER_NONE) || downcased.include?(Label::NONE)
+ downcased.include?(FILTER_NONE)
end
def filter_by_any_label?
@@ -449,8 +448,7 @@ class IssuableFinder
# rubocop: enable CodeReuse/ActiveRecord
def filter_by_no_assignee?
- # Assignee_id takes precedence over assignee_username
- [NONE, FILTER_NONE].include?(params[:assignee_id].to_s.downcase) || params[:assignee_username].to_s == NONE
+ params[:assignee_id].to_s.downcase == FILTER_NONE
end
def filter_by_any_assignee?
diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb
index 18fe2a9624f..0fd8dca70b4 100644
--- a/app/models/broadcast_message.rb
+++ b/app/models/broadcast_message.rb
@@ -17,13 +17,11 @@ class BroadcastMessage < ApplicationRecord
default_value_for :font, '#FFFFFF'
CACHE_KEY = 'broadcast_message_current_json'.freeze
- LEGACY_CACHE_KEY = 'broadcast_message_current'.freeze
after_commit :flush_redis_cache
def self.current
messages = cache.fetch(CACHE_KEY, as: BroadcastMessage, expires_in: cache_expires_in) do
- remove_legacy_cache_key
current_and_future_messages
end
@@ -50,14 +48,6 @@ class BroadcastMessage < ApplicationRecord
nil
end
- # This can be removed in GitLab 12.0+
- # The old cache key had an indefinite lifetime, and in an HA
- # environment a one-shot migration would not work because the cache
- # would be repopulated by a node that has not been upgraded.
- def self.remove_legacy_cache_key
- cache.expire(LEGACY_CACHE_KEY)
- end
-
def active?
started? && !ended?
end
@@ -84,6 +74,5 @@ class BroadcastMessage < ApplicationRecord
def flush_redis_cache
self.class.cache.expire(CACHE_KEY)
- self.class.remove_legacy_cache_key
end
end
diff --git a/app/models/label.rb b/app/models/label.rb
index e9085e8bd25..b83e0862bab 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -13,7 +13,6 @@ class Label < ApplicationRecord
cache_markdown_field :description, pipeline: :single_line
DEFAULT_COLOR = '#428BCA'
- NONE = 'no label'
default_value_for :color, DEFAULT_COLOR