From e6a876cbd4a2a438d4bd122d34c404529b3e0140 Mon Sep 17 00:00:00 2001 From: Lucas Caton Date: Sun, 1 Dec 2024 10:30:38 +1000 Subject: [PATCH] Allow sqlite3 v2 when using Rails 7.1 or newer --- Appraisals | 6 +++++- gemfiles/rails_7.1.gemfile | 2 +- gemfiles/rails_7.2.gemfile | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Appraisals b/Appraisals index 0082da9..0dc6211 100644 --- a/Appraisals +++ b/Appraisals @@ -13,6 +13,10 @@ rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versi gem 'activesupport', "~> #{current_version}" gem 'activerecord', "~> #{current_version}" - gem 'sqlite3', '< 2' # v2.x isn't yet working. See: https://github.com/sparklemotion/sqlite3-ruby/issues/529 + if Gem::Version.new(rails_version) > Gem::Version.new(7.0) + gem 'sqlite3' + else + gem 'sqlite3', '< 2' # Rails 6.x and 7.0 require sqlite3 v1.x + end end end diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile index 87e5f92..939e5fa 100644 --- a/gemfiles/rails_7.1.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -4,6 +4,6 @@ source 'https://rubygems.org' gem 'activerecord', '~> 7.1.5' gem 'activesupport', '~> 7.1.5' -gem 'sqlite3', '< 2' +gem 'sqlite3' gemspec path: '../' diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile index 4961e15..080bd6b 100644 --- a/gemfiles/rails_7.2.gemfile +++ b/gemfiles/rails_7.2.gemfile @@ -4,6 +4,6 @@ source 'https://rubygems.org' gem 'activerecord', '~> 7.2.2' gem 'activesupport', '~> 7.2.2' -gem 'sqlite3', '< 2' +gem 'sqlite3' gemspec path: '../'