summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-19 11:48:10 +0200
committerRémy Coutable <remy@rymai.me>2016-04-19 11:48:10 +0200
commit6970612bcc5b9a74c00abea129a8afc7cbe681bb (patch)
treeea8a49154219d711bf2abf57065035bb6f8dd515 /lib
parent1fbea7cec974d3c215c0e5fae389c05b802b0600 (diff)
downloadgitlab-ce-6970612bcc5b9a74c00abea129a8afc7cbe681bb.tar.gz
Get rid of more requires, which causes warnings when code is reloaded15139-fix-constants-redefinition-warnings
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r--lib/file_size_validator.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/file_size_validator.rb b/lib/file_size_validator.rb
index 7b136c2bbe5..440dd44ece7 100644
--- a/lib/file_size_validator.rb
+++ b/lib/file_size_validator.rb
@@ -1,9 +1,9 @@
class FileSizeValidator < ActiveModel::EachValidator
- MESSAGES ||= { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
- CHECKS ||= { is: :==, minimum: :>=, maximum: :<= }.freeze
+ MESSAGES = { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
+ CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
- DEFAULT_TOKENIZER ||= -> (value) { value.split(//) }.freeze
- RESERVED_OPTIONS ||= [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long].freeze
+ DEFAULT_TOKENIZER = -> (value) { value.split(//) }.freeze
+ RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long].freeze
def initialize(options)
if range = (options.delete(:in) || options.delete(:within))