mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix duplicate branch in Spree::Preferences::Preferable private method
:string, :text and :password cases have the same value
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user