From 2be8ef96be976238f25dcd88c396b982c1b7d2d5 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 20 Sep 2024 16:35:41 +1000 Subject: [PATCH] Remove unreachable code These two methods return early if `active` is falsey. So for the rest of the method we can assume `active` to be truthy. --- app/serializers/api/cached_enterprise_serializer.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/serializers/api/cached_enterprise_serializer.rb b/app/serializers/api/cached_enterprise_serializer.rb index d9e08a0155..fa80ca12c3 100644 --- a/app/serializers/api/cached_enterprise_serializer.rb +++ b/app/serializers/api/cached_enterprise_serializer.rb @@ -95,9 +95,7 @@ module Api .merge(Exchange.to_enterprise(enterprise)) .select('DISTINCT spree_properties.*') - return properties.merge(OrderCycle.active) if active - - properties + properties.merge(OrderCycle.active) end def distributed_producer_properties @@ -113,9 +111,7 @@ module Api .merge(Exchange.to_enterprise(enterprise)) .select('DISTINCT spree_properties.*') - return properties.merge(OrderCycle.active) if active - - properties + properties.merge(OrderCycle.active) end def active