summaryrefslogtreecommitdiff
path: root/app/models/appearance.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-05-04 19:23:50 +0200
committerRémy Coutable <remy@rymai.me>2018-05-23 16:14:43 +0200
commite531a0c11cebc282029ba735d69c44c39660ca34 (patch)
treeb757a7d9c4ad235ba19b0172a52b0a17a6e32835 /app/models/appearance.rb
parent02f17a0988acfdc60d7e1f920e8f750cb81f09d0 (diff)
downloadgitlab-ce-e531a0c11cebc282029ba735d69c44c39660ca34.tar.gz
Use the new CacheableAttributes concern in the ApplicationSetting and Appearance models
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/appearance.rb')
-rw-r--r--app/models/appearance.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/models/appearance.rb b/app/models/appearance.rb
index f8713138a93..67cc84a9140 100644
--- a/app/models/appearance.rb
+++ b/app/models/appearance.rb
@@ -1,6 +1,6 @@
class Appearance < ActiveRecord::Base
+ include CacheableAttributes
include CacheMarkdownField
- include AfterCommitQueue
include ObjectStorage::BackgroundMove
include WithUploads
@@ -15,16 +15,9 @@ class Appearance < ActiveRecord::Base
mount_uploader :logo, AttachmentUploader
mount_uploader :header_logo, AttachmentUploader
- CACHE_KEY = "current_appearance:#{Gitlab::VERSION}".freeze
-
- after_commit :flush_redis_cache
-
- def self.current
- Rails.cache.fetch(CACHE_KEY) { first }
- end
-
- def flush_redis_cache
- Rails.cache.delete(CACHE_KEY)
+ # Overrides CacheableAttributes.current_without_cache
+ def self.current_without_cache
+ first
end
def single_appearance_row