Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resolves] Rails 6 test suite #624

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
sudo: required
os: linux

language: ruby
services:
- docker
rvm:
- jruby-9.1.15.0
- jruby-9.1.17.0
- 2.1.9
- 2.2.9
- 2.3.6
Expand All @@ -29,11 +30,11 @@ before_install:
env:
RUBY_GC_MALLOC_LIMIT: 90000000
RUBY_GC_HEAP_FREE_SLOTS: 200000
matrix:
jobs:
allow_failures:
- rvm: ruby-head
- gemfile: gemfiles/rails_master.gemfile
- rvm: jruby-9.1.15.0
- rvm: jruby-9.1.17.0
gemfile: gemfiles/rails_5_0.gemfile
exclude:
- rvm: 2.1.9
Expand All @@ -46,19 +47,19 @@ matrix:
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.1.9
gemfile: gemfiles/rails_master.gemfile
- rvm: 2.2.9
- rvm: 2.2.9
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.3.6
gemfile: gemfiles/rails_6_0.gemfile
- rvm: 2.4.3
gemfile: gemfiles/rails_6_0.gemfile
- rvm: jruby-9.1.15.0
- rvm: jruby-9.1.17.0
gemfile: gemfiles/rails_5_1.gemfile
- rvm: jruby-9.1.15.0
- rvm: jruby-9.1.17.0
gemfile: gemfiles/rails_5_2.gemfile
- rvm: jruby-9.1.15.0
- rvm: jruby-9.1.17.0
gemfile: gemfiles/rails_6_0.gemfile
- rvm: jruby-9.1.15.0
- rvm: jruby-9.1.17.0
gemfile: gemfiles/rails_master.gemfile
fast_finish: true
cache: bundler
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'http://rubygems.org'

gemspec

gem 'rails', '>= 3.1.2'
gem 'rails', '>= 3.1.2'

group :local do
gem 'pry'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Note that you can disable the default migrating of all tenants with `db:migrate`

Apartment supports parallelizing migrations into multiple threads when
you have a large number of tenants. By default, parallel migrations is
turned off. You can enable this by setting `parallel_migration_threads` to
turned off. You can enable this by setting `parallel_migration_threads` to
the number of threads you want to use in your initializer.

Keep in mind that because migrations are going to access the database,
Expand Down
10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ def activerecord_below_5_2?
ActiveRecord.version.release < Gem::Version.new('5.2.0')
end

def activerecord_below_6_0?
ActiveRecord.version.release < Gem::Version.new('6.0.0')
end

def migrate
if activerecord_below_5_2?
ActiveRecord::Migrator.migrate('spec/dummy/db/migrate')
else
elsif activerecord_below_6_0?
ActiveRecord::MigrationContext.new('spec/dummy/db/migrate').migrate
else
# TODO: Figure out if there is any other possibility that can/should be
# passed here as the second argument for the migration context
ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate
end
end