Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamhoff committed May 17, 2024
1 parent 32ae0cc commit 1900daa
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions core/app/models/spree/simple_order_contents.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1900daa

Please sign in to comment.