Enable Style/ZeroLengthPredicate
This commit is contained in:
parent
1b8e38253e
commit
1f4ef0074f
4 changed files with 4 additions and 4 deletions
|
@ -1268,4 +1268,4 @@ Style/YodaCondition:
|
|||
Enabled: false
|
||||
|
||||
Style/ZeroLengthPredicate:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
|
|
@ -20,7 +20,7 @@ module Carto
|
|||
def convert_driver_result_to_full_address
|
||||
result = JSON.parse(driver.call)
|
||||
|
||||
if result['features'].size == 0
|
||||
if result['features'].empty?
|
||||
Rails.logger.error "unable to find location for address #{@address}"
|
||||
return []
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ module Carto
|
|||
|
||||
def convert_driver_result_to_point
|
||||
result = JSON.parse(driver.call)
|
||||
if result['features'].size == 0
|
||||
if result['features'].empty?
|
||||
Rails.logger.error "unable to find location for address #{@address}"
|
||||
return nil
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
|
|||
def sanitize_name(name) # from https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/sanitized_file.rb#L323
|
||||
name = name.gsub(/[^[:word:]\.\-\+]/,"_")
|
||||
name = "_#{name}" if name.match?(/\A\.+\z/)
|
||||
name = "unnamed" if name.size == 0
|
||||
name = "unnamed" if name.empty?
|
||||
return name.mb_chars.to_s
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue