Skip to content

Commit

Permalink
Add rails 7.0 to CI (#293)
Browse files Browse the repository at this point in the history
Add 7.0 to Appraisal
Fix issue in the test helper for rails 7
  • Loading branch information
deepakmahakale committed Sep 13, 2022
1 parent 0ab3cb5 commit a46ffb8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -20,13 +20,13 @@ jobs:
gemfile:
- gemfiles/rails_5.2.gemfile
- gemfiles/rails_6.0.gemfile
# - gemfiles/rails_7.0.gemfile
- gemfiles/rails_7.0.gemfile
# - gemfile: gemfiles/rails_head.gemfile
exclude:
# - ruby: '2.5'
# gemfile: gemfiles/rails_7.0.gemfile
# - ruby: '2.6'
# gemfile: gemfiles/rails_7.0.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails_7.0.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails_7.0.gemfile
- ruby: '2.7'
gemfile: gemfiles/rails_5.2.gemfile
- ruby: '3.0'
Expand Down
10 changes: 5 additions & 5 deletions Appraisals
@@ -1,11 +1,11 @@
appraise "rails-5.1" do
appraise "rails-5.2" do
gem "rails", "~> 5.2"
end

appraise "rails-5.2" do
gem "rails", "~> 5.2"
appraise "rails-6.0" do
gem "rails", "~> 6.0"
end

appraise "rails-6.0.1" do
gem "rails", "~> 6.0.1"
appraise "rails-7.0" do
gem "rails", "~> 7.0"
end
2 changes: 1 addition & 1 deletion gemfiles/rails_5.2.gemfile
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", "~> 5.2.0"
gem "rails", "~> 5.2"

group :development, :test do
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
Expand Down
8 changes: 4 additions & 4 deletions test/test_helper.rb
Expand Up @@ -18,12 +18,12 @@

# https://github.com/plataformatec/devise/blob/master/test/orm/active_record.rb
migrate_path = File.expand_path("../rails_app/db/migrate", __FILE__)
if Rails.version.start_with? '6'
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
elsif Rails.version.start_with? '5.2'
if ActiveRecord.version < Gem::Version.create("5.2.0")
ActiveRecord::Migrator.migrate(migrate_path)
elsif ActiveRecord.version < Gem::Version.create("6.0.0")
ActiveRecord::MigrationContext.new(migrate_path).migrate
else
ActiveRecord::Migrator.migrate(migrate_path)
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
end

# Load support files
Expand Down

0 comments on commit a46ffb8

Please sign in to comment.