mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
Use guard clauses where possible
This commit is contained in:
@@ -30,9 +30,8 @@ module Spree
|
||||
|
||||
# Currently can only destroy the whole customer object
|
||||
def destroy_at_stripe
|
||||
if stripe_customer = Stripe::Customer.retrieve( @credit_card.gateway_customer_profile_id )
|
||||
stripe_customer.delete
|
||||
end
|
||||
stripe_customer = Stripe::Customer.retrieve(@credit_card.gateway_customer_profile_id)
|
||||
stripe_customer.delete if stripe_customer
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -9,9 +9,9 @@ Spree::UsersController.class_eval do
|
||||
def show
|
||||
@orders = @user.orders.where(state: 'complete').order('completed_at desc')
|
||||
|
||||
if Spree::Config.accounts_distributor_id
|
||||
@orders = @orders.where('distributor_id != ?', Spree::Config.accounts_distributor_id)
|
||||
end
|
||||
return unless Spree::Config.accounts_distributor_id
|
||||
|
||||
@orders = @orders.where('distributor_id != ?', Spree::Config.accounts_distributor_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user