diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a581319b80..b8d47b2e57 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -638,7 +638,7 @@ Style/OptionalBooleanParameter: - "core/app/mailers/spree/reimbursement_mailer.rb" - "core/app/models/concerns/spree/user_address_book.rb" - "core/app/models/spree/order.rb" - - "core/app/models/spree/order_contents.rb" + - "core/app/models/spree/simple_order_contents.rb" - "core/app/models/spree/stock/estimator.rb" # Offense count: 4 diff --git a/core/app/models/spree/simple_order_contents.rb b/core/app/models/spree/simple_order_contents.rb index 6e50556342..5eb63689b4 100644 --- a/core/app/models/spree/simple_order_contents.rb +++ b/core/app/models/spree/simple_order_contents.rb @@ -82,7 +82,7 @@ def add_to_line_item(variant, quantity, options = {}) line_item ||= order.line_items.new( quantity: 0, variant: variant, - adjustments: [], + adjustments: [] ) line_item.quantity += quantity.to_i @@ -110,7 +110,7 @@ def remove_from_line_item(variant, quantity, options = {}) def grab_line_item_by_variant(variant, raise_error = false, options = {}) line_item = order.find_line_item_by_variant(variant, options) - if !line_item.present? && raise_error + if line_item.blank? && raise_error raise ActiveRecord::RecordNotFound, "Line item not found for variant #{variant.sku}" end