Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update return clause for menu.root

Matthew Kennedy66507ef0931a
diff --git a/core/app/models/spree/menu.rb b/core/app/models/spree/menu.rb
index cba0e28f3a..4067818213 100644
--- a/core/app/models/spree/menu.rb
+++ b/core/app/models/spree/menu.rb
@@ -33,9 +33,7 @@ module Spree
define_singleton_method("for_#{location_name}") do |locale|
menu = find_by(location: location_name, locale: locale.to_s)
- if menu.present?
- menu.root
- end
+ menu.root if menu.present?
end
end
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb
index e07843b36e..d5c703062b 100644
--- a/core/app/models/spree/store.rb
+++ b/core/app/models/spree/store.rb
@@ -61,9 +61,7 @@ module Spree
def default_menu(location)
menu = menus.find_by(location: location, locale: default_locale) || menus.find_by(location: location)
- if menu.present?
- menu.root
- end
+ menu.root if menu.present?
end
def supported_currencies_list