From 148ee31ce4cb54b7297155b0d40c2d132cb8171e Mon Sep 17 00:00:00 2001 From: Brandon Hicks Date: Sat, 10 Aug 2024 10:48:41 -0600 Subject: [PATCH 1/2] CHANGED: Update supported Rails version to v7.2 --- CHANGELOG.md | 5 ++++- devise-otp.gemspec | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353a6b9..c26ba47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Upgrade gemspec to support Rails v7.2 + ## 0.7.0 Breaking changes: @@ -57,4 +61,3 @@ Fixes: - mandatory otp fix by @cotcomsol in #68 - remove success message by @strzibny in #69 - diff --git a/devise-otp.gemspec b/devise-otp.gemspec index 05d77f5..56688b2 100644 --- a/devise-otp.gemspec +++ b/devise-otp.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |gem| gem.files = `git ls-files`.split($/) gem.require_paths = ["lib"] - gem.add_runtime_dependency "rails", ">= 6.1", "< 7.2" + gem.add_runtime_dependency "rails", ">= 6.1", "<= 7.2" gem.add_runtime_dependency "devise", ">= 4.8.0", "< 5.0" gem.add_runtime_dependency "rotp", ">= 2.0.0" From ef05170a48b8f0fbb3fdcec87c225d94ed8f63a2 Mon Sep 17 00:00:00 2001 From: Brandon Hicks Date: Wed, 14 Aug 2024 22:19:52 -0600 Subject: [PATCH 2/2] CHANGED: Resolve ActiveRecord migratioon issue --- test/orm/active_record.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/orm/active_record.rb b/test/orm/active_record.rb index 41cab52..da895aa 100644 --- a/test/orm/active_record.rb +++ b/test/orm/active_record.rb @@ -3,4 +3,9 @@ migrations_path = File.expand_path("../../dummy/db/migrate/", __FILE__) -ActiveRecord::MigrationContext.new(migrations_path, ActiveRecord::SchemaMigration).migrate +if Rails.version.to_f >= 7.2 + ActiveRecord::MigrationContext.new(migrations_path).migrate +else + # To support order versions of Rails (pre v7.2) + ActiveRecord::MigrationContext.new(migrations_path, ActiveRecord::SchemaMigration).migrate +end