Fix duplicate branch in Spree::Preferences::Preferable private method

:string, :text and :password cases have the same value
This commit is contained in:
Ana Nunes da Silva
2024-03-28 19:50:46 +00:00
parent 5fde1cc7cd
commit eedbaaff6e
2 changed files with 1 additions and 13 deletions

View File

@@ -23,16 +23,6 @@ Lint/ConstantDefinitionInBlock:
- 'spec/validators/date_time_string_validator_spec.rb'
- 'spec/validators/integer_array_validator_spec.rb'
# Offense count: 6
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Exclude:
# - 'app/helpers/spree/admin/base_helper.rb'
# - 'app/models/enterprise.rb'
# - 'app/models/spree/calculator.rb'
# - 'app/models/spree/preference.rb'
- 'app/models/spree/preferences/preferable.rb'
# Offense count: 2
Lint/DuplicateMethods:
Exclude:

View File

@@ -111,9 +111,7 @@ module Spree
def convert_preference_value(value, type)
case type
when :string, :text
value.to_s
when :password
when :string, :text, :password
value.to_s
when :decimal
value = 0 if value.blank?