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.

Rails 8.1 support

Damian Legawiec5ce2735c1e5d
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb
index 536edc327b..7515ed2de7 100644
--- a/common_spree_dependencies.rb
+++ b/common_spree_dependencies.rb
@@ -4,7 +4,7 @@
source 'https://rubygems.org'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
-gem 'rails', ENV.fetch('RAILS_VERSION', '~> 8.0.0'), require: false
+gem 'rails', ENV.fetch('RAILS_VERSION', '~> 8.1.0'), require: false
platforms :jruby do
gem 'jruby-openssl'
diff --git a/core/lib/spree/database_type_utilities.rb b/core/lib/spree/database_type_utilities.rb
index f3c86bc4e6..3aaf54efda 100644
--- a/core/lib/spree/database_type_utilities.rb
+++ b/core/lib/spree/database_type_utilities.rb
@@ -1,9 +1,12 @@
module Spree
module DatabaseTypeUtilities
+ # Maximum value for a 4-byte signed integer (default database integer type)
+ INTEGER_MAX = (2**31) - 1
+
def self.maximum_value_for(data_type)
case data_type
when :integer
- ActiveModel::Type::Integer.new.instance_eval { range.max }
+ INTEGER_MAX
else
raise ArgumentError, 'Currently only :integer argument is acceptable'
end
diff --git a/core/spree_core.gemspec b/core/spree_core.gemspec
index 6d68299fb6..04f0b67b8a 100644
--- a/core/spree_core.gemspec
+++ b/core/spree_core.gemspec
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'i18n-tasks'
- s.add_dependency 'rails', '>= 7.2', '< 8.1'
+ s.add_dependency 'rails', '>= 7.2', '< 8.2'
s.add_dependency 'activemerchant', '~> 1.67'
s.add_dependency 'acts_as_list', '>= 0.8'
diff --git a/install.sh b/install.sh
index 118387aa03..5b9f5bd436 100755
--- a/install.sh
+++ b/install.sh
@@ -21,7 +21,7 @@ BOLD='\033[1m'
NC='\033[0m' # No Color
# Configuration
-RAILS_VERSION="8.0.4"
+RAILS_VERSION="8.1.1"
APP_NAME=""
LOAD_SAMPLE_DATA="false"
TEMPLATE_URL="https://raw.githubusercontent.com/spree/spree/main/template.rb"
diff --git a/storefront/Gemfile b/storefront/Gemfile
index e9efd3fb9a..1bd01d94af 100644
--- a/storefront/Gemfile
+++ b/storefront/Gemfile
@@ -7,6 +7,7 @@ gem 'spree_emails', path: '../emails'
gem 'spree_page_builder', path: '../page_builder'
gem 'devise'
+gem 'canonical-rails', github: 'commonlit/canonical-rails', branch: "bump-rails-8-1" # temporary fix for Rails 8.1 compatibility
group :test, :development do
gem 'selenium-webdriver'
diff --git a/template.rb b/template.rb
index df467265ae..d9dfd16a9d 100644
--- a/template.rb
+++ b/template.rb
@@ -15,6 +15,8 @@ def add_gems
# Core dependencies
gem 'devise'
+ gem 'canonical-rails', github: 'commonlit/canonical-rails', branch: "bump-rails-8-1" # temporary fix for Rails 8.1 compatibility
+
# Spree gems - using main branch for latest
gem 'spree', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
gem 'spree_emails', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }