Project

General

Profile

« Previous | Next » 

Revision d7c67746

Added by Michael Moll almost 6 years ago

Fixes #19873 - Fix Style/MultilineIfModifier cop (#5705)

  • Refs #20891 - fix for new rubocop rules
  • Fixes #19873 - Fix Style/MultilineIfModifier cop

View differences:

app/models/lookup_keys/lookup_key.rb
def value_before_type_cast(val)
return val if val.nil? || val.contains_erb?
case key_type.to_sym
when :json, :array
val = JSON.dump(val)
when :yaml, :hash
val = YAML.dump val
val.sub!(/\A---\s*$\n/, '')
end if key_type.present?
if key_type.present?
case key_type.to_sym
when :json, :array
val = JSON.dump(val)
when :yaml, :hash
val = YAML.dump val
val.sub!(/\A---\s*$\n/, '')
end
end
val
end

Also available in: Unified diff