Skip to content

Commit

Permalink
Merge pull request #56 from sue445/feature/rails_6.0.0.rc2
Browse files Browse the repository at this point in the history
Fix CI on activerecord v6.0.0.rc2
  • Loading branch information
sue445 authored Jul 26, 2019
2 parents ff76872 + 22f2da3 commit 97664fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "rails", "~> 6.0.0.rc1"
gem "rails", "~> 6.0.0.rc2"

# c.f. https://github.com/rails/rails/blob/v6.0.0.rc1/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L13
gem "sqlite3", "~> 1.4"
Expand Down
8 changes: 6 additions & 2 deletions spec/db/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def up_migrate
ActiveRecord::Tasks::DatabaseTasks.create(configuration)

# db:migrate
if ActiveRecord.version >= Gem::Version.create("5.2.0")
if ActiveRecord.version >= Gem::Version.create("6.0.0.rc2")
ActiveRecord::MigrationContext.new(migrate_dir, ActiveRecord::SchemaMigration).up
elsif ActiveRecord.version >= Gem::Version.create("5.2.0")
ActiveRecord::MigrationContext.new(migrate_dir).up
else
ActiveRecord::Migrator.up(migrate_dir)
Expand All @@ -31,7 +33,9 @@ def up_migrate

def down_migrate
# db:down
if ActiveRecord.version >= Gem::Version.create("5.2.0")
if ActiveRecord.version >= Gem::Version.create("6.0.0.rc2")
ActiveRecord::MigrationContext.new(migrate_dir, ActiveRecord::SchemaMigration).down
elsif ActiveRecord.version >= Gem::Version.create("5.2.0")
ActiveRecord::MigrationContext.new(migrate_dir).down
else
ActiveRecord::Migrator.down(migrate_dir)
Expand Down

0 comments on commit 97664fb

Please sign in to comment.