Enable the Style/ClassCheck cop
This commit is contained in:
parent
fba8d97256
commit
616e9305e9
2 changed files with 3 additions and 3 deletions
|
@ -847,7 +847,7 @@ Style/ClassAndModuleChildren:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/ClassCheck:
|
Style/ClassCheck:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Style/ClassMethods:
|
Style/ClassMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
|
@ -41,11 +41,11 @@ class FileSizeValidator < ActiveModel::EachValidator
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_each(record, attribute, value)
|
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")
|
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected")
|
||||||
end
|
end
|
||||||
|
|
||||||
if value.kind_of?(String)
|
if value.is_a?(String)
|
||||||
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value)
|
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue