From a916f6b0c8cbfee3b0148678d54ec85df04c6b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 22 Jun 2017 12:55:58 +0200 Subject: [PATCH] remove some warnings with already declared constants --- app/models/global_setting.rb | 6 +++--- app/services/badge_granter.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/global_setting.rb b/app/models/global_setting.rb index 8ecfd750041..2ee90b7bc1f 100644 --- a/app/models/global_setting.rb +++ b/app/models/global_setting.rb @@ -6,12 +6,12 @@ class GlobalSetting end end - VALID_SECRET_KEY = /^[0-9a-f]{128}$/ + VALID_SECRET_KEY ||= /^[0-9a-f]{128}$/ # this is named SECRET_TOKEN as opposed to SECRET_KEY_BASE # for legacy reasons - REDIS_SECRET_KEY = 'SECRET_TOKEN' + REDIS_SECRET_KEY ||= 'SECRET_TOKEN' - REDIS_VALIDATE_SECONDS = 30 + REDIS_VALIDATE_SECONDS ||= 30 # In Rails secret_key_base is used to encrypt the cookie store # the cookie store contains session data diff --git a/app/services/badge_granter.rb b/app/services/badge_granter.rb index 33923050b28..cfde16aa135 100644 --- a/app/services/badge_granter.rb +++ b/app/services/badge_granter.rb @@ -223,7 +223,7 @@ class BadgeGranter {errors: e.message} end - MAX_ITEMS_FOR_DELTA = 200 + MAX_ITEMS_FOR_DELTA ||= 200 def self.backfill(badge, opts=nil) return unless SiteSetting.enable_badges return unless badge.enabled