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 sample to accomodate changes in years (#11596)

Collins Lagat0609f5c1694a
diff --git a/sample/db/samples/menu_items.rb b/sample/db/samples/menu_items.rb
index ef9ce4493c..4d8020a1d1 100644
--- a/sample/db/samples/menu_items.rb
+++ b/sample/db/samples/menu_items.rb
@@ -207,7 +207,7 @@ MENUS.each do |menu|
promos = []
end
- summer = Spree::Taxon.find_by!(permalink: 'categories/new-collection/summer-2021')
+ summer = Spree::Taxon.find_by!(permalink: "categories/new-collection/summer-#{Date.today.year}")
offers = Spree::Taxon.find_by!(permalink: 'categories/special-offers/30-percent-off')
#####################
diff --git a/sample/db/samples/taxons.rb b/sample/db/samples/taxons.rb
index bf66522e04..40bcf62475 100644
--- a/sample/db/samples/taxons.rb
+++ b/sample/db/samples/taxons.rb
@@ -4,7 +4,7 @@ Spree::Sample.load_sample('taxonomies')
ADDITIONAL_TAXONS = ['Bestsellers', 'Trending', 'Streetstyle', 'Summer Sale'].freeze
-SPECIAL_TAXONS = { 'New Collection': 'Summer 2021', 'Special Offers': '30% Off' }.freeze
+SPECIAL_TAXONS = { 'New Collection': "Summer #{Date.today.year}", 'Special Offers': '30% Off' }.freeze
CHILDREN_TAXON_NAMES = CSV.read(File.join(__dir__, 'variants.csv')).map do |(parent_name, taxon_name, _product_name, _color_name)|
[parent_name, taxon_name]