From 8b93c5ab5624d4adfd392fd6bc980d57ee3531d5 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 23 Mar 2020 17:17:20 +0100 Subject: [PATCH] Invert conditionals for better readability --- app/models/stock/package.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/stock/package.rb b/app/models/stock/package.rb index ffa76ffa72..eada3741c1 100644 --- a/app/models/stock/package.rb +++ b/app/models/stock/package.rb @@ -26,8 +26,8 @@ module Stock def shipping_methods available_shipping_methods = super.to_a - available_shipping_methods.delete_if do |shipping_method| - !ships_with?(order.distributor.shipping_methods.to_a, shipping_method) + available_shipping_methods.keep_if do |shipping_method| + ships_with?(order.distributor.shipping_methods.to_a, shipping_method) end end