From 616e9305e975bef5ecc54833137efb61cd2b81ac Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 18 Dec 2018 22:18:08 +0100 Subject: [PATCH] Enable the Style/ClassCheck cop --- .rubocop.yml | 2 +- app/lib/file_size_validator.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0e764ee4d..a778255ba 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -847,7 +847,7 @@ Style/ClassAndModuleChildren: Enabled: false Style/ClassCheck: - Enabled: false + Enabled: true Style/ClassMethods: Enabled: true diff --git a/app/lib/file_size_validator.rb b/app/lib/file_size_validator.rb index eb9f987f0..83fc09774 100644 --- a/app/lib/file_size_validator.rb +++ b/app/lib/file_size_validator.rb @@ -41,11 +41,11 @@ class FileSizeValidator < ActiveModel::EachValidator end def validate_each(record, attribute, value) - if !value.kind_of?(CarrierWave::Uploader::Base) + if !value.is_a?(CarrierWave::Uploader::Base) raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") end - if value.kind_of?(String) + if value.is_a?(String) value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) end