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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Bump Rails to 7.0.0.rc1 (#11555)
Damian Legawiec2446dfac2fd2
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rbindex aebb808b9c..e6e726ab12 100644--- a/common_spree_dependencies.rb+++ b/common_spree_dependencies.rb@@ -9,7 +9,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]actionmailer actionpack actionview activejob activemodel activerecordactivestorage activesupport railties].each do |rails_gem|- gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.0.0.alpha2'), require: false+ gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.0.0.rc1'), require: falseendplatforms :jruby do@@ -24,6 +24,8 @@ platforms :ruby doendend+gem 'sprockets-rails', '>= 2.0.0'+if ENV['RAILS_VERSION']&.match(/7\.0\.0/) || !ENV['RAILS_VERSION']gem 'paranoia', github: 'payrollhero/paranoia', branch: 'rails7'gem 'awesome_nested_set', github: 'damianlegawiec/awesome_nested_set', branch: 'master'diff --git a/core/app/models/spree/order_merger.rb b/core/app/models/spree/order_merger.rbindex adc310ee0d..83c29af6ff 100644--- a/core/app/models/spree/order_merger.rb+++ b/core/app/models/spree/order_merger.rb@@ -54,7 +54,7 @@ module Spree# Change the error messages as you choose.def handle_error(line_item)- order.errors[:base] << line_item.errors.full_messages+ order.errors.add(:base, line_item.errors.full_messages)enddef persist_mergediff --git a/core/app/models/spree/promotion_rule.rb b/core/app/models/spree/promotion_rule.rbindex 43ed52310c..4dac29c322 100644--- a/core/app/models/spree/promotion_rule.rb+++ b/core/app/models/spree/promotion_rule.rb@@ -35,7 +35,7 @@ module Spreedef unique_per_promotionif Spree::PromotionRule.exists?(promotion_id: promotion_id, type: self.class.name)- errors[:base] << 'Promotion already contains this rule type'+ errors.add(:base, 'Promotion already contains this rule type')endenddiff --git a/core/spec/lib/spree/core/importer/order_spec.rb b/core/spec/lib/spree/core/importer/order_spec.rbindex 959335632f..31cef18f8e 100644--- a/core/spec/lib/spree/core/importer/order_spec.rb+++ b/core/spec/lib/spree/core/importer/order_spec.rb@@ -439,7 +439,8 @@ module Spreeline_items_attributes: line_items,adjustments_attributes: [{ label: 'Order Discount', amount: -5.99 }- ]+ ],+ additional_tax_total: 0}order = Importer::Order.import(user, params)diff --git a/core/spec/models/spree/promotion_rule_spec.rb b/core/spec/models/spree/promotion_rule_spec.rbindex 7c880f8e8f..c3f057ab18 100644--- a/core/spec/models/spree/promotion_rule_spec.rb+++ b/core/spec/models/spree/promotion_rule_spec.rb@@ -10,18 +10,17 @@ module Spreeendend+ let!(:promotion) { create(:promotion) }+it 'forces developer to implement eligible? method' doexpect { BadTestRule.new.eligible? }.to raise_error(ArgumentError)endit 'validates unique rules for a promotion' do- p1 = TestRule.new- p1.promotion_id = 1- p1.save+ TestRule.create!(promotion: promotion)- p2 = TestRule.new- p2.promotion_id = 1- expect(p2).not_to be_valid+ promotion_rule = TestRule.new(promotion: promotion)+ expect(promotion_rule).not_to be_validendendend