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

BP-2147 | Hotfix: Added support for Rails 6 multi-database switching #1

Merged
merged 5 commits into from Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 20 additions & 3 deletions .travis.yml
@@ -1,15 +1,32 @@
addons:
postgresql: 9.6
dist: trusty
language: ruby
cache: bundler

rvm:
- 2.2.4
- 2.3.1
- 2.6.3
- jruby-9.0.5.0

gemfile:
- gemfiles/rails_5_1.gemfile

bundler_args: --without local
before_install:
- gem install bundler -v '> 1.5.0'
- gem update --system
- gem install bundler

before_script:
- psql -c 'create database apartment_postgresql_test;' -U postgres

env:
RUBY_GC_MALLOC_LIMIT: 90000000
RUBY_FREE_MIN: 200000

matrix:
fast_finish: true

notifications:
email:
on_success: never
on_failure: always
3 changes: 2 additions & 1 deletion lib/apartment/adapters/abstract_adapter.rb
Expand Up @@ -83,7 +83,7 @@ def switch!(tenant)

@current = tenant

Apartment.connection.clear_query_cache
Apartment.connection_class.clear_query_caches_for_current_thread

tenant
end
Expand Down Expand Up @@ -143,6 +143,7 @@ def connection_switch!(config, without_keys: [])
end

Thread.current[:_apartment_connection_specification_name] = config[:name]
Apartment.connection_class.connection_specification_name = config[:name]
simple_switch(config)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/apartment/version.rb
@@ -1,3 +1,3 @@
module Apartment
VERSION = "2.0.0"
VERSION = "2.0.1"
end