ros-apartment 2.6.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/changelog.yml +63 -0
  3. data/.rubocop.yml +74 -4
  4. data/.rubocop_todo.yml +50 -13
  5. data/.story_branch.yml +1 -0
  6. data/.travis.yml +5 -0
  7. data/CHANGELOG.md +949 -0
  8. data/Gemfile +1 -1
  9. data/Guardfile +0 -15
  10. data/HISTORY.md +159 -68
  11. data/README.md +13 -3
  12. data/Rakefile +4 -2
  13. data/TODO.md +0 -1
  14. data/gemfiles/rails_5_0.gemfile +1 -1
  15. data/gemfiles/rails_5_1.gemfile +1 -1
  16. data/gemfiles/rails_5_2.gemfile +1 -1
  17. data/gemfiles/rails_6_0.gemfile +1 -1
  18. data/gemfiles/rails_master.gemfile +1 -1
  19. data/lib/apartment.rb +13 -12
  20. data/lib/apartment/active_record/connection_handling.rb +3 -0
  21. data/lib/apartment/active_record/internal_metadata.rb +0 -2
  22. data/lib/apartment/active_record/schema_migration.rb +0 -2
  23. data/lib/apartment/adapters/abstract_adapter.rb +9 -4
  24. data/lib/apartment/adapters/abstract_jdbc_adapter.rb +2 -1
  25. data/lib/apartment/adapters/jdbc_postgresql_adapter.rb +2 -1
  26. data/lib/apartment/adapters/mysql2_adapter.rb +5 -0
  27. data/lib/apartment/adapters/postgresql_adapter.rb +48 -1
  28. data/lib/apartment/console.rb +2 -8
  29. data/lib/apartment/custom_console.rb +4 -2
  30. data/lib/apartment/log_subscriber.rb +27 -0
  31. data/lib/apartment/railtie.rb +15 -10
  32. data/lib/apartment/tasks/task_helper.rb +40 -0
  33. data/lib/apartment/tenant.rb +4 -8
  34. data/lib/apartment/version.rb +1 -1
  35. data/lib/generators/apartment/install/templates/apartment.rb +7 -1
  36. data/lib/tasks/apartment.rake +18 -42
  37. data/{apartment.gemspec → ros-apartment.gemspec} +2 -4
  38. metadata +15 -12
  39. data/.github/workflows/.rubocop-linter.yml +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0f6acd23ac1eab76581c3753f6833cb1a1b7b317e9652582721a2f6ad84500c
4
- data.tar.gz: 0fc60c72b7148707b3d7530b41418873487cbe9de825b4e0e9bc8b82bc66a60e
3
+ metadata.gz: e12a4c472f448bc3f74307242fe0fb0929262c2a7fc5780996e8d49aa8421aff
4
+ data.tar.gz: 6bed24032f44c0669bca2fd92f0cd182f0d410752102493ff900709509d5f22e
5
5
  SHA512:
6
- metadata.gz: b08ff81c0a66ba663774b2d96893fcbc1d5451b581b76957195bf7c09735351195368b45a7dda8f1e023f77fb0d5c8eb46c385ecae5e7d35840358cfe849a61d
7
- data.tar.gz: c41e3675d25662bd4806466f97eff40f5f9548676a35450548fcdf98c27beca0c27e19935fe4d101b703f944bcdee09b07183314a140405183c7a192c3b4c062
6
+ metadata.gz: a8ed3d29e8b56c61e2ca40134a421d7b6921e639e14f12ef492acb94bf7ef6b1df197b5f7f81541da0933acb946e4094080ee20e8b4c77e06e4b299acdb4ef1c
7
+ data.tar.gz: 18239dac52eb752c5d456c1004fe2f2424fa8dbe85bc20bfb5db45280a6df4948f5ae554f78f847698f74217809da4ebe549da5e91b9c2a69a910ef6a28d7b65
@@ -0,0 +1,63 @@
1
+ name: Changelog
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+
7
+ release:
8
+ types: [published]
9
+
10
+ issues:
11
+ types: [closed, edited]
12
+
13
+ jobs:
14
+ generate_changelog:
15
+ runs-on: ubuntu-latest
16
+ name: Generate changelog for master branch
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ with:
20
+ fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
21
+
22
+ - name: Generate changelog
23
+ uses: charmixer/auto-changelog-action@v1
24
+ with:
25
+ token: ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name: Commit files
28
+ env:
29
+ ACTION_EMAIL: action@github.com
30
+ ACTION_USERNAME: GitHub Action
31
+ run: |
32
+ git config --local user.email "$ACTION_EMAIL"
33
+ git config --local user.name "$ACTION_USERNAME"
34
+ git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
35
+
36
+ - name: Push changes
37
+ if: env.push == 1
38
+ env:
39
+ # CI_USER: ${{ secrets.YOUR_GITHUB_USER }}
40
+ CI_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
41
+ run: |
42
+ git push "https://$GITHUB_ACTOR:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master
43
+
44
+ # - name: Push changelog to master
45
+ # if: env.push == 1
46
+ # uses: ad-m/github-push-action@master
47
+ # with:
48
+ # github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
49
+ # branch: master
50
+
51
+ # - name: Cherry-pick changelog to development
52
+ # if: env.push == 1
53
+ # env:
54
+ # ACTION_EMAIL: action@github.com
55
+ # ACTION_USERNAME: GitHub Action
56
+ # run: |
57
+ # git config --local user.email "$ACTION_EMAIL"
58
+ # git config --local user.name "$ACTION_USERNAME"
59
+ # commit_hash=`git show HEAD | egrep commit\ .+$ | cut -d' ' -f2`
60
+ # git checkout development
61
+ # git pull
62
+ # git cherry-pick $commit_hash
63
+ # git push
@@ -1,12 +1,9 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- inherit_gem:
4
- perx-rubocop:
5
- - default.yml
6
-
7
3
  AllCops:
8
4
  Exclude:
9
5
  - 'gemfiles/**/*.gemfile'
6
+ - 'gemfiles/vendor/**/*'
10
7
 
11
8
  Style/WordArray:
12
9
  Exclude:
@@ -19,3 +16,76 @@ Style/NumericLiterals:
19
16
  Layout/EmptyLineAfterMagicComment:
20
17
  Exclude:
21
18
  - spec/schemas/**/*.rb
19
+
20
+ Metrics/BlockLength:
21
+ Exclude:
22
+ - spec/**/*.rb
23
+
24
+ Layout/EmptyLinesAroundAttributeAccessor:
25
+ Enabled: true
26
+
27
+ Layout/SpaceAroundMethodCallOperator:
28
+ Enabled: true
29
+
30
+ Lint/DeprecatedOpenSSLConstant:
31
+ Enabled: true
32
+
33
+ Lint/DuplicateElsifCondition:
34
+ Enabled: true
35
+
36
+ Lint/MixedRegexpCaptureTypes:
37
+ Enabled: true
38
+
39
+ Lint/RaiseException:
40
+ Enabled: true
41
+
42
+ Lint/StructNewOverride:
43
+ Enabled: true
44
+
45
+ Style/AccessorGrouping:
46
+ Enabled: true
47
+
48
+ Style/ArrayCoercion:
49
+ Enabled: true
50
+
51
+ Style/BisectedAttrAccessor:
52
+ Enabled: true
53
+
54
+ Style/CaseLikeIf:
55
+ Enabled: true
56
+
57
+ Style/ExponentialNotation:
58
+ Enabled: true
59
+
60
+ Style/HashAsLastArrayItem:
61
+ Enabled: true
62
+
63
+ Style/HashEachMethods:
64
+ Enabled: true
65
+
66
+ Style/HashLikeCase:
67
+ Enabled: true
68
+
69
+ Style/HashTransformKeys:
70
+ Enabled: true
71
+
72
+ Style/HashTransformValues:
73
+ Enabled: true
74
+
75
+ Style/RedundantAssignment:
76
+ Enabled: true
77
+
78
+ Style/RedundantFetchBlock:
79
+ Enabled: true
80
+
81
+ Style/RedundantFileExtensionInRequire:
82
+ Enabled: true
83
+
84
+ Style/RedundantRegexpCharacterClass:
85
+ Enabled: true
86
+
87
+ Style/RedundantRegexpEscape:
88
+ Enabled: true
89
+
90
+ Style/SlicingWithRange:
91
+ Enabled: true
@@ -1,29 +1,66 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-02-16 15:36:55 +0800 using RuboCop version 0.77.0.
3
+ # on 2020-07-16 04:15:41 UTC using RuboCop version 0.88.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 5
9
+ # Offense count: 1
10
+ Lint/MixedRegexpCaptureTypes:
11
+ Exclude:
12
+ - 'lib/apartment/elevators/domain.rb'
13
+
14
+ # Offense count: 2
15
+ # Cop supports --auto-correct.
16
+ Lint/NonDeterministicRequireOrder:
17
+ Exclude:
18
+ - 'spec/spec_helper.rb'
19
+
20
+ # Offense count: 7
21
+ # Configuration parameters: IgnoredMethods.
10
22
  Metrics/AbcSize:
11
23
  Max: 33
12
24
 
13
- # Offense count: 11
14
- # Configuration parameters: CountComments, ExcludedMethods.
25
+ # Offense count: 3
26
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
15
27
  # ExcludedMethods: refine
16
28
  Metrics/BlockLength:
17
- Max: 176
29
+ Max: 102
18
30
 
19
- # Offense count: 18
20
- # Cop supports --auto-correct.
21
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
22
- # URISchemes: http, https
23
- Metrics/LineLength:
24
- Max: 200
31
+ # Offense count: 1
32
+ # Configuration parameters: CountComments, CountAsOne.
33
+ Metrics/ClassLength:
34
+ Max: 151
25
35
 
26
- # Offense count: 4
27
- # Configuration parameters: CountComments, ExcludedMethods.
36
+ # Offense count: 6
37
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
28
38
  Metrics/MethodLength:
29
39
  Max: 24
40
+
41
+ # Offense count: 17
42
+ Style/Documentation:
43
+ Exclude:
44
+ - 'spec/**/*'
45
+ - 'test/**/*'
46
+ - 'lib/apartment/adapters/jdbc_mysql_adapter.rb'
47
+ - 'lib/apartment/adapters/postgis_adapter.rb'
48
+ - 'lib/apartment/adapters/postgresql_adapter.rb'
49
+ - 'lib/apartment/adapters/sqlite3_adapter.rb'
50
+ - 'lib/apartment/custom_console.rb'
51
+ - 'lib/apartment/deprecation.rb'
52
+ - 'lib/apartment/migrator.rb'
53
+ - 'lib/apartment/model.rb'
54
+ - 'lib/apartment/railtie.rb'
55
+ - 'lib/apartment/reloader.rb'
56
+ - 'lib/apartment/tasks/enhancements.rb'
57
+ - 'lib/apartment/tasks/task_helper.rb'
58
+ - 'lib/generators/apartment/install/install_generator.rb'
59
+
60
+ # Offense count: 3
61
+ # Cop supports --auto-correct.
62
+ Style/IfUnlessModifier:
63
+ Exclude:
64
+ - 'Rakefile'
65
+ - 'lib/apartment.rb'
66
+ - 'lib/apartment/tenant.rb'
@@ -1,4 +1,5 @@
1
1
  ---
2
2
  tracker: github
3
+ issue_placement: beginning
3
4
  project_id:
4
5
  - rails-on-services/apartment
@@ -29,10 +29,15 @@ before_install:
29
29
  - sudo /etc/init.d/mysql stop
30
30
  - sudo /etc/init.d/postgresql stop
31
31
  - docker-compose up -d
32
+
32
33
  env:
33
34
  RUBY_GC_MALLOC_LIMIT: 90000000
34
35
  RUBY_GC_HEAP_FREE_SLOTS: 200000
35
36
  jobs:
37
+ include:
38
+ - name: Rubocop Lint
39
+ script: gem install rubocop
40
+
36
41
  allow_failures:
37
42
  - rvm: ruby-head
38
43
  - rvm: jruby-head
@@ -0,0 +1,949 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](https://github.com/rails-on-services/apartment/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.7.2...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Uses a transaction to create a tenant [\#66](https://github.com/rails-on-services/apartment/issues/66)
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Fix seeding errors [\#86](https://github.com/rails-on-services/apartment/issues/86)
14
+ - When tests run in a transaction, new tenants in tests fail to create [\#123](https://github.com/rails-on-services/apartment/issues/123)
15
+ - Reverted unsafe initializer - introduces the possibility of disabling the initial connection to the database via
16
+ environment variable. Relates to the following tickets/PRs:
17
+ - [#113](https://github.com/rails-on-services/apartment/issues/113)
18
+ - [#39](https://github.com/rails-on-services/apartment/pull/39)
19
+ - [#53](https://github.com/rails-on-services/apartment/pull/53)
20
+ - [#118](https://github.com/rails-on-services/apartment/pull/118)
21
+
22
+ **Closed issues:**
23
+
24
+ - Improve changelog automatic generation [\#98](https://github.com/rails-on-services/apartment/issues/98)
25
+ - Relaxes dependencies to allow rails 6.1 [\#121](https://github.com/rails-on-services/apartment/issues/121)
26
+
27
+ ## [v2.7.2](https://github.com/rails-on-services/apartment/tree/v2.7.2) (2020-07-17)
28
+
29
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.7.1...v2.7.2)
30
+
31
+ **Implemented enhancements:**
32
+
33
+ - Deprecate History.md [\#80](https://github.com/rails-on-services/apartment/issues/80)
34
+
35
+ **Fixed bugs:**
36
+
37
+ - Tenant.switch! raises exception on first call / Postgresql [\#92](https://github.com/rails-on-services/apartment/issues/92)
38
+ - NameError: instance variable @sequence\_name not defined [\#81](https://github.com/rails-on-services/apartment/issues/81)
39
+
40
+ **Closed issues:**
41
+
42
+ - Error creating tenant with uuid column [\#85](https://github.com/rails-on-services/apartment/issues/85)
43
+ - enhanced db:create task breaks plugins compatibility [\#82](https://github.com/rails-on-services/apartment/issues/82)
44
+ - Support disabling of full\_migration\_on\_create [\#30](https://github.com/rails-on-services/apartment/issues/30)
45
+
46
+ **Merged pull requests:**
47
+
48
+ - \[Chore\] Fix Changelog github action [\#97](https://github.com/rails-on-services/apartment/pull/97) ([rpbaltazar](https://github.com/rpbaltazar))
49
+ - Prepare release - 2.7.2 [\#96](https://github.com/rails-on-services/apartment/pull/96) ([rpbaltazar](https://github.com/rpbaltazar))
50
+ - \[Resolves \#92\] tenant switch raises exception on first call [\#95](https://github.com/rails-on-services/apartment/pull/95) ([rpbaltazar](https://github.com/rpbaltazar))
51
+ - Dont use custom rubocop [\#94](https://github.com/rails-on-services/apartment/pull/94) ([rpbaltazar](https://github.com/rpbaltazar))
52
+ - \[Resolves \#80\] added changelog action [\#90](https://github.com/rails-on-services/apartment/pull/90) ([rpbaltazar](https://github.com/rpbaltazar))
53
+ - \[Resolves \#81\] check for var existence before [\#89](https://github.com/rails-on-services/apartment/pull/89) ([rpbaltazar](https://github.com/rpbaltazar))
54
+
55
+ ## [v2.7.1](https://github.com/rails-on-services/apartment/tree/v2.7.1) (2020-06-27)
56
+
57
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.7.0...v2.7.1)
58
+
59
+ **Merged pull requests:**
60
+
61
+ - Prepare Release 2.7.1 [\#84](https://github.com/rails-on-services/apartment/pull/84) ([rpbaltazar](https://github.com/rpbaltazar))
62
+ - \[Resolves \#82\] Enhanced db create task breaks plugins compatibility [\#83](https://github.com/rails-on-services/apartment/pull/83) ([rpbaltazar](https://github.com/rpbaltazar))
63
+ - \[ci\] update rake [\#79](https://github.com/rails-on-services/apartment/pull/79) ([ahorek](https://github.com/ahorek))
64
+
65
+ ## [v2.7.0](https://github.com/rails-on-services/apartment/tree/v2.7.0) (2020-06-26)
66
+
67
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.6.1...v2.7.0)
68
+
69
+ **Implemented enhancements:**
70
+
71
+ - Rake tasks define methods on main [\#70](https://github.com/rails-on-services/apartment/issues/70)
72
+
73
+ **Fixed bugs:**
74
+
75
+ - Undefined method devise with 2.6.1 [\#65](https://github.com/rails-on-services/apartment/issues/65)
76
+ - db:create is failed [\#61](https://github.com/rails-on-services/apartment/issues/61)
77
+
78
+ **Closed issues:**
79
+
80
+ - configure story branch [\#68](https://github.com/rails-on-services/apartment/issues/68)
81
+ - HISTORY.md has not been updated for latest releases [\#62](https://github.com/rails-on-services/apartment/issues/62)
82
+ - \[Postgresql users\] Help testing development branch in your environment [\#34](https://github.com/rails-on-services/apartment/issues/34)
83
+
84
+ **Merged pull requests:**
85
+
86
+ - Prepare Release - 2.7.0 [\#77](https://github.com/rails-on-services/apartment/pull/77) ([rpbaltazar](https://github.com/rpbaltazar))
87
+ - \[Fixes \#61\] db create is failed [\#76](https://github.com/rails-on-services/apartment/pull/76) ([rpbaltazar](https://github.com/rpbaltazar))
88
+ - \[Resolves \#70\] rake tasks define methods on main [\#75](https://github.com/rails-on-services/apartment/pull/75) ([rpbaltazar](https://github.com/rpbaltazar))
89
+ - \[Chore\] Update travis config to run rubocop [\#74](https://github.com/rails-on-services/apartment/pull/74) ([rpbaltazar](https://github.com/rpbaltazar))
90
+ - Remove and warn depracated config `tld\_length` [\#72](https://github.com/rails-on-services/apartment/pull/72) ([choznerol](https://github.com/choznerol))
91
+ - \[Resolves \#62\] added Missing notes in history.md [\#63](https://github.com/rails-on-services/apartment/pull/63) ([rpbaltazar](https://github.com/rpbaltazar))
92
+ - Add database and schema to active record log [\#55](https://github.com/rails-on-services/apartment/pull/55) ([woohoou](https://github.com/woohoou))
93
+
94
+ ## [v2.6.1](https://github.com/rails-on-services/apartment/tree/v2.6.1) (2020-06-02)
95
+
96
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.6.0...v2.6.1)
97
+
98
+ **Closed issues:**
99
+
100
+ - db:rollback uses second latest migration for tenants [\#56](https://github.com/rails-on-services/apartment/issues/56)
101
+ - rake db:setup tries to seed non existing tenant [\#52](https://github.com/rails-on-services/apartment/issues/52)
102
+ - Custom Console deprecation warning [\#37](https://github.com/rails-on-services/apartment/issues/37)
103
+
104
+ **Merged pull requests:**
105
+
106
+ - Version bump - 2.6.1 [\#60](https://github.com/rails-on-services/apartment/pull/60) ([rpbaltazar](https://github.com/rpbaltazar))
107
+ - Prepare Release - 2.6.1 [\#59](https://github.com/rails-on-services/apartment/pull/59) ([rpbaltazar](https://github.com/rpbaltazar))
108
+ - \[\#56\] Db rollback uses second latest migration [\#57](https://github.com/rails-on-services/apartment/pull/57) ([rpbaltazar](https://github.com/rpbaltazar))
109
+ - \[\#52\] enhance after db create [\#54](https://github.com/rails-on-services/apartment/pull/54) ([rpbaltazar](https://github.com/rpbaltazar))
110
+ - fix init after reload on development [\#53](https://github.com/rails-on-services/apartment/pull/53) ([fsateler](https://github.com/fsateler))
111
+ - fix: reset sequence\_name after tenant switch [\#51](https://github.com/rails-on-services/apartment/pull/51) ([fsateler](https://github.com/fsateler))
112
+ - Avoid early connection [\#39](https://github.com/rails-on-services/apartment/pull/39) ([fsateler](https://github.com/fsateler))
113
+
114
+ ## [v2.6.0](https://github.com/rails-on-services/apartment/tree/v2.6.0) (2020-05-14)
115
+
116
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.5.0...v2.6.0)
117
+
118
+ **Closed issues:**
119
+
120
+ - Error Dropping Tenant [\#46](https://github.com/rails-on-services/apartment/issues/46)
121
+ - After switch callback not working with nil argument [\#42](https://github.com/rails-on-services/apartment/issues/42)
122
+ - Add tenant info to console boot? [\#41](https://github.com/rails-on-services/apartment/issues/41)
123
+ - Support configuration for skip checking of schema existence before switching [\#26](https://github.com/rails-on-services/apartment/issues/26)
124
+
125
+ **Merged pull requests:**
126
+
127
+ - \[Resolves \#37\] Custom console deprecation warning [\#49](https://github.com/rails-on-services/apartment/pull/49) ([rpbaltazar](https://github.com/rpbaltazar))
128
+ - Prepare Release 2.6.0 [\#48](https://github.com/rails-on-services/apartment/pull/48) ([rpbaltazar](https://github.com/rpbaltazar))
129
+ - Add console welcome message [\#47](https://github.com/rails-on-services/apartment/pull/47) ([JeremiahChurch](https://github.com/JeremiahChurch))
130
+ - \[Resolves \#26\] Support configuration for skip checking of schema existence before switching [\#45](https://github.com/rails-on-services/apartment/pull/45) ([rpbaltazar](https://github.com/rpbaltazar))
131
+ - \[Resolves \#42\] After switch callback not working with nil argument [\#43](https://github.com/rails-on-services/apartment/pull/43) ([rpbaltazar](https://github.com/rpbaltazar))
132
+
133
+ ## [v2.5.0](https://github.com/rails-on-services/apartment/tree/v2.5.0) (2020-05-05)
134
+
135
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/2.4.0...v2.5.0)
136
+
137
+ **Implemented enhancements:**
138
+
139
+ - Add latest ruby verisons to test matrix [\#31](https://github.com/rails-on-services/apartment/issues/31)
140
+ - Deprecate EOL ruby and rails versions [\#11](https://github.com/rails-on-services/apartment/issues/11)
141
+
142
+ **Fixed bugs:**
143
+
144
+ - When manually switching the connection it resets the search path [\#27](https://github.com/rails-on-services/apartment/issues/27)
145
+
146
+ **Closed issues:**
147
+
148
+ - Cached statement breaks in find [\#35](https://github.com/rails-on-services/apartment/issues/35)
149
+ - rails 6.1.alpha support [\#6](https://github.com/rails-on-services/apartment/issues/6)
150
+ - How to exclude all models from engine? [\#4](https://github.com/rails-on-services/apartment/issues/4)
151
+
152
+ **Merged pull requests:**
153
+
154
+ - Prepare Release 2.5.0 [\#44](https://github.com/rails-on-services/apartment/pull/44) ([rpbaltazar](https://github.com/rpbaltazar))
155
+ - \[Resolves \#27\] Added before hook to connected to to try to set the tenant [\#40](https://github.com/rails-on-services/apartment/pull/40) ([rpbaltazar](https://github.com/rpbaltazar))
156
+ - \[Resolves \#35\] update cache key to use a string or an array [\#36](https://github.com/rails-on-services/apartment/pull/36) ([rpbaltazar](https://github.com/rpbaltazar))
157
+ - \[Hotfix \#27\] Some errors were being thrown due to caching issues [\#33](https://github.com/rails-on-services/apartment/pull/33) ([rpbaltazar](https://github.com/rpbaltazar))
158
+ - \[Resolves \#31\] Add latest ruby verisons to test matrix [\#32](https://github.com/rails-on-services/apartment/pull/32) ([rpbaltazar](https://github.com/rpbaltazar))
159
+ - \[Chore\] refactored files to their names [\#29](https://github.com/rails-on-services/apartment/pull/29) ([rpbaltazar](https://github.com/rpbaltazar))
160
+ - \[Resolves \#27\] When manually switching the connection it resets the search path [\#28](https://github.com/rails-on-services/apartment/pull/28) ([rpbaltazar](https://github.com/rpbaltazar))
161
+ - \[Resolves \#11\] Remove old ruby and rails versions from the supported versions [\#20](https://github.com/rails-on-services/apartment/pull/20) ([rpbaltazar](https://github.com/rpbaltazar))
162
+ - Support rails 6.1 [\#7](https://github.com/rails-on-services/apartment/pull/7) ([jean-francois-labbe](https://github.com/jean-francois-labbe))
163
+
164
+ ## [2.4.0](https://github.com/rails-on-services/apartment/tree/2.4.0) (2020-04-01)
165
+
166
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.3.0...2.4.0)
167
+
168
+ **Implemented enhancements:**
169
+
170
+ - Add console info about tenants and fast switches [\#14](https://github.com/rails-on-services/apartment/issues/14)
171
+ - Update travis config to only run PR's instead of running all commits [\#12](https://github.com/rails-on-services/apartment/issues/12)
172
+
173
+ **Closed issues:**
174
+
175
+ - Rubocop cleanup [\#9](https://github.com/rails-on-services/apartment/issues/9)
176
+ - Apartment.configure throws NoMethodError [\#3](https://github.com/rails-on-services/apartment/issues/3)
177
+ - upcoming Rails 6 multi-database [\#2](https://github.com/rails-on-services/apartment/issues/2)
178
+
179
+ **Merged pull requests:**
180
+
181
+ - Fix gemspec open versions and updated version [\#25](https://github.com/rails-on-services/apartment/pull/25) ([rpbaltazar](https://github.com/rpbaltazar))
182
+ - Fix gemspec open versions and updated version [\#24](https://github.com/rails-on-services/apartment/pull/24) ([rpbaltazar](https://github.com/rpbaltazar))
183
+ - Cleanup travis matrix [\#23](https://github.com/rails-on-services/apartment/pull/23) ([rpbaltazar](https://github.com/rpbaltazar))
184
+ - Prepare v2.4.0 Release [\#22](https://github.com/rails-on-services/apartment/pull/22) ([rpbaltazar](https://github.com/rpbaltazar))
185
+ - Updated readme badges [\#21](https://github.com/rails-on-services/apartment/pull/21) ([rpbaltazar](https://github.com/rpbaltazar))
186
+ - Rescuing ActiveRecord::NoDatabaseError when dropping tenants [\#19](https://github.com/rails-on-services/apartment/pull/19) ([rpbaltazar](https://github.com/rpbaltazar))
187
+ - Skip init if we're running webpacker:compile [\#18](https://github.com/rails-on-services/apartment/pull/18) ([rpbaltazar](https://github.com/rpbaltazar))
188
+ - \[Resolves \#14\] Add console info about tenants and fast switches [\#17](https://github.com/rails-on-services/apartment/pull/17) ([rpbaltazar](https://github.com/rpbaltazar))
189
+ - Don't crash when no database connection is present [\#16](https://github.com/rails-on-services/apartment/pull/16) ([ArthurWD](https://github.com/ArthurWD))
190
+ - \[Resolves \#12\] Update travis config to only run PRs instead of all commits [\#13](https://github.com/rails-on-services/apartment/pull/13) ([rpbaltazar](https://github.com/rpbaltazar))
191
+ - \[Chore\] Fix rubocop usage [\#10](https://github.com/rails-on-services/apartment/pull/10) ([rpbaltazar](https://github.com/rpbaltazar))
192
+ - \[Resolves \#9\] Cleanup rubocop todo [\#8](https://github.com/rails-on-services/apartment/pull/8) ([rpbaltazar](https://github.com/rpbaltazar))
193
+ - Rakefile should use mysql port from configuration [\#5](https://github.com/rails-on-services/apartment/pull/5) ([jean-francois-labbe](https://github.com/jean-francois-labbe))
194
+
195
+ ## [v2.3.0](https://github.com/rails-on-services/apartment/tree/v2.3.0) (2020-01-03)
196
+
197
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.2.1...v2.3.0)
198
+
199
+ **Merged pull requests:**
200
+
201
+ - \[Resolves\] Basic support for Rails 6 [\#1](https://github.com/rails-on-services/apartment/pull/1) ([rpbaltazar](https://github.com/rpbaltazar))
202
+
203
+ ## [v2.2.1](https://github.com/rails-on-services/apartment/tree/v2.2.1) (2019-06-19)
204
+
205
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.2.0...v2.2.1)
206
+
207
+ ## [v2.2.0](https://github.com/rails-on-services/apartment/tree/v2.2.0) (2018-04-13)
208
+
209
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.1.0...v2.2.0)
210
+
211
+ ## [v2.1.0](https://github.com/rails-on-services/apartment/tree/v2.1.0) (2017-12-15)
212
+
213
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v2.0.0...v2.1.0)
214
+
215
+ ## [v2.0.0](https://github.com/rails-on-services/apartment/tree/v2.0.0) (2017-07-26)
216
+
217
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v1.2.0...v2.0.0)
218
+
219
+ ## [v1.2.0](https://github.com/rails-on-services/apartment/tree/v1.2.0) (2016-07-28)
220
+
221
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v1.1.0...v1.2.0)
222
+
223
+ ## [v1.1.0](https://github.com/rails-on-services/apartment/tree/v1.1.0) (2016-05-26)
224
+
225
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v1.0.2...v1.1.0)
226
+
227
+ ## [v1.0.2](https://github.com/rails-on-services/apartment/tree/v1.0.2) (2015-07-02)
228
+
229
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v1.0.1...v1.0.2)
230
+
231
+ ## [v1.0.1](https://github.com/rails-on-services/apartment/tree/v1.0.1) (2015-04-28)
232
+
233
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v1.0.0...v1.0.1)
234
+
235
+ ## [v1.0.0](https://github.com/rails-on-services/apartment/tree/v1.0.0) (2015-02-03)
236
+
237
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.26.1...v1.0.0)
238
+
239
+ ## [v0.26.1](https://github.com/rails-on-services/apartment/tree/v0.26.1) (2015-01-13)
240
+
241
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.26.0...v0.26.1)
242
+
243
+ ## [v0.26.0](https://github.com/rails-on-services/apartment/tree/v0.26.0) (2015-01-05)
244
+
245
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.25.2...v0.26.0)
246
+
247
+ ## [v0.25.2](https://github.com/rails-on-services/apartment/tree/v0.25.2) (2014-09-08)
248
+
249
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.25.1...v0.25.2)
250
+
251
+ ## [v0.25.1](https://github.com/rails-on-services/apartment/tree/v0.25.1) (2014-07-17)
252
+
253
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.25.0...v0.25.1)
254
+
255
+ ## [v0.25.0](https://github.com/rails-on-services/apartment/tree/v0.25.0) (2014-07-03)
256
+
257
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.24.3...v0.25.0)
258
+
259
+ ## [v0.24.3](https://github.com/rails-on-services/apartment/tree/v0.24.3) (2014-03-05)
260
+
261
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.24.2...v0.24.3)
262
+
263
+ ## [v0.24.2](https://github.com/rails-on-services/apartment/tree/v0.24.2) (2014-02-24)
264
+
265
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.24.1...v0.24.2)
266
+
267
+ ## [v0.24.1](https://github.com/rails-on-services/apartment/tree/v0.24.1) (2014-02-21)
268
+
269
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.24.0...v0.24.1)
270
+
271
+ ## [v0.24.0](https://github.com/rails-on-services/apartment/tree/v0.24.0) (2014-02-21)
272
+
273
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.23.2...v0.24.0)
274
+
275
+ ## [v0.23.2](https://github.com/rails-on-services/apartment/tree/v0.23.2) (2014-01-09)
276
+
277
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.23.1...v0.23.2)
278
+
279
+ ## [v0.23.1](https://github.com/rails-on-services/apartment/tree/v0.23.1) (2014-01-08)
280
+
281
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.23.0...v0.23.1)
282
+
283
+ ## [v0.23.0](https://github.com/rails-on-services/apartment/tree/v0.23.0) (2013-12-15)
284
+
285
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.22.1...v0.23.0)
286
+
287
+ ## [v0.22.1](https://github.com/rails-on-services/apartment/tree/v0.22.1) (2013-08-21)
288
+
289
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.22.0...v0.22.1)
290
+
291
+ ## [v0.22.0](https://github.com/rails-on-services/apartment/tree/v0.22.0) (2013-07-09)
292
+
293
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.21.1...v0.22.0)
294
+
295
+ ## [v0.21.1](https://github.com/rails-on-services/apartment/tree/v0.21.1) (2013-05-31)
296
+
297
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.21.0...v0.21.1)
298
+
299
+ ## [v0.21.0](https://github.com/rails-on-services/apartment/tree/v0.21.0) (2013-04-25)
300
+
301
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.20.0...v0.21.0)
302
+
303
+ ## [v0.20.0](https://github.com/rails-on-services/apartment/tree/v0.20.0) (2013-02-06)
304
+
305
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/rm...v0.20.0)
306
+
307
+ ## [rm](https://github.com/rails-on-services/apartment/tree/rm) (2013-01-30)
308
+
309
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.19.2...rm)
310
+
311
+ ## [v0.19.2](https://github.com/rails-on-services/apartment/tree/v0.19.2) (2013-01-30)
312
+
313
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.19.0...v0.19.2)
314
+
315
+ ## [v0.19.0](https://github.com/rails-on-services/apartment/tree/v0.19.0) (2012-12-30)
316
+
317
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.18.0...v0.19.0)
318
+
319
+ ## [v0.18.0](https://github.com/rails-on-services/apartment/tree/v0.18.0) (2012-11-28)
320
+
321
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.17.3...v0.18.0)
322
+
323
+ ## [v0.17.3](https://github.com/rails-on-services/apartment/tree/v0.17.3) (2012-11-20)
324
+
325
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.17.2...v0.17.3)
326
+
327
+ ## [v0.17.2](https://github.com/rails-on-services/apartment/tree/v0.17.2) (2012-11-15)
328
+
329
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.17.1...v0.17.2)
330
+
331
+ ## [v0.17.1](https://github.com/rails-on-services/apartment/tree/v0.17.1) (2012-10-30)
332
+
333
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.17.0...v0.17.1)
334
+
335
+ ## [v0.17.0](https://github.com/rails-on-services/apartment/tree/v0.17.0) (2012-09-26)
336
+
337
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.16.0...v0.17.0)
338
+
339
+ ## [v0.16.0](https://github.com/rails-on-services/apartment/tree/v0.16.0) (2012-06-01)
340
+
341
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.15.0...v0.16.0)
342
+
343
+ ## [v0.15.0](https://github.com/rails-on-services/apartment/tree/v0.15.0) (2012-03-18)
344
+
345
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.14.4...v0.15.0)
346
+
347
+ ## [v0.14.4](https://github.com/rails-on-services/apartment/tree/v0.14.4) (2012-03-08)
348
+
349
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.14.3...v0.14.4)
350
+
351
+ ## [v0.14.3](https://github.com/rails-on-services/apartment/tree/v0.14.3) (2012-02-21)
352
+
353
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.14.2...v0.14.3)
354
+
355
+ ## [v0.14.2](https://github.com/rails-on-services/apartment/tree/v0.14.2) (2012-02-21)
356
+
357
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.13.0.1...v0.14.2)
358
+
359
+ ## [v0.13.0.1](https://github.com/rails-on-services/apartment/tree/v0.13.0.1) (2012-02-09)
360
+
361
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.14.1...v0.13.0.1)
362
+
363
+ ## [v0.14.1](https://github.com/rails-on-services/apartment/tree/v0.14.1) (2011-12-13)
364
+
365
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.14.0...v0.14.1)
366
+
367
+ ## [v0.14.0](https://github.com/rails-on-services/apartment/tree/v0.14.0) (2011-12-13)
368
+
369
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.13.1...v0.14.0)
370
+
371
+ ## [v0.13.1](https://github.com/rails-on-services/apartment/tree/v0.13.1) (2011-11-08)
372
+
373
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.13.0...v0.13.1)
374
+
375
+ ## [v0.13.0](https://github.com/rails-on-services/apartment/tree/v0.13.0) (2011-10-25)
376
+
377
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.12.0...v0.13.0)
378
+
379
+ ## [v0.12.0](https://github.com/rails-on-services/apartment/tree/v0.12.0) (2011-10-04)
380
+
381
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.11.1...v0.12.0)
382
+
383
+ ## [v0.11.1](https://github.com/rails-on-services/apartment/tree/v0.11.1) (2011-09-22)
384
+
385
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.11.0...v0.11.1)
386
+
387
+ ## [v0.11.0](https://github.com/rails-on-services/apartment/tree/v0.11.0) (2011-09-20)
388
+
389
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.10.3...v0.11.0)
390
+
391
+ ## [v0.10.3](https://github.com/rails-on-services/apartment/tree/v0.10.3) (2011-09-20)
392
+
393
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.10.2...v0.10.3)
394
+
395
+ ## [v0.10.2](https://github.com/rails-on-services/apartment/tree/v0.10.2) (2011-09-15)
396
+
397
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.10.1...v0.10.2)
398
+
399
+ ## [v0.10.1](https://github.com/rails-on-services/apartment/tree/v0.10.1) (2011-08-11)
400
+
401
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.10.0...v0.10.1)
402
+
403
+ ## [v0.10.0](https://github.com/rails-on-services/apartment/tree/v0.10.0) (2011-07-29)
404
+
405
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.9.2...v0.10.0)
406
+
407
+ ## [v0.9.2](https://github.com/rails-on-services/apartment/tree/v0.9.2) (2011-07-04)
408
+
409
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.9.1...v0.9.2)
410
+
411
+ ## [v0.9.1](https://github.com/rails-on-services/apartment/tree/v0.9.1) (2011-06-24)
412
+
413
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.9.0...v0.9.1)
414
+
415
+ ## [v0.9.0](https://github.com/rails-on-services/apartment/tree/v0.9.0) (2011-06-23)
416
+
417
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.8.0...v0.9.0)
418
+
419
+ ## [v0.8.0](https://github.com/rails-on-services/apartment/tree/v0.8.0) (2011-06-23)
420
+
421
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.7.0...v0.8.0)
422
+
423
+ ## [v0.7.0](https://github.com/rails-on-services/apartment/tree/v0.7.0) (2011-06-22)
424
+
425
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.6.0...v0.7.0)
426
+
427
+ ## [v0.6.0](https://github.com/rails-on-services/apartment/tree/v0.6.0) (2011-06-21)
428
+
429
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/0.6.0...v0.6.0)
430
+
431
+ ## [0.6.0](https://github.com/rails-on-services/apartment/tree/0.6.0) (2011-06-21)
432
+
433
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.5.1...0.6.0)
434
+
435
+ ## [v0.5.1](https://github.com/rails-on-services/apartment/tree/v0.5.1) (2011-06-21)
436
+
437
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/0.5.0...v0.5.1)
438
+
439
+ ## [0.5.0](https://github.com/rails-on-services/apartment/tree/0.5.0) (2011-06-20)
440
+
441
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.5.0...0.5.0)
442
+
443
+ ## [v0.5.0](https://github.com/rails-on-services/apartment/tree/v0.5.0) (2011-06-20)
444
+
445
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/v0.1.3...v0.5.0)
446
+
447
+ ## [v0.1.3](https://github.com/rails-on-services/apartment/tree/v0.1.3) (2011-04-18)
448
+
449
+ [Full Changelog](https://github.com/rails-on-services/apartment/compare/7100f34a185ab7d48947f06aa8c14f0cf0a68bb7...v0.1.3)
450
+
451
+ # v2.7.1
452
+
453
+ **Implemented enhancements:**
454
+
455
+ - N/a
456
+
457
+ **Fixed bugs:**
458
+
459
+ - [Resolves #82] Enhanced db:create breaks plugin compatibility - <https://github.com/rails-on-services/apartment/pull/83>
460
+
461
+ **Closed issues:**
462
+
463
+ - Update rake version in development
464
+ - Renamed gemspec to match gem name
465
+
466
+ # v2.7.0
467
+
468
+ **Implemented enhancements:**
469
+
470
+ - [Resolves #70] Rake tasks define methods on main - <https://github.com/rails-on-services/apartment/pull/75>
471
+ - Add database and schema to active record log. Configurable, defaults to false to keep current behavior - <https://github.com/rails-on-services/apartment/pull/55>
472
+
473
+ **Fixed bugs:**
474
+
475
+ - [Fixes #61] Fix database create in mysql - <https://github.com/rails-on-services/apartment/pull/76>
476
+
477
+ **Closed issues:**
478
+
479
+ - Remove deprecated tld_length config option: tld_length was removed in influitive#309, this configuration option doesn't have any effect now. - <https://github.com/rails-on-services/apartment/pull/72>
480
+ - Using [diffend.io proxy](https://diffend.io) to safely check required gems
481
+ - Added [story branch](https://github.com/story-branch/story_branch) to the configuration
482
+ - Using travis-ci to run rubocop as well, replacing github actions: github actions do not work in fork's PRs
483
+
484
+ # v2.6.1
485
+
486
+ **Implemented enhancements:**
487
+ - N/a
488
+
489
+ **Fixed bugs:**
490
+ - [Resolves influitive#607] Avoid early connection
491
+ - <https://github.com/rails-on-services/apartment/pull/39>
492
+ - <https://github.com/rails-on-services/apartment/pull/53>
493
+ - <https://github.com/rails-on-services/apartment/pull/51>
494
+ - [Resolves #52] Rake db:setup tries to seed non existent tenant - <https://github.com/rails-on-services/apartment/pull/54>
495
+ - [Resolves #56] DB rollback uses second last migration - <https://github.com/rails-on-services/apartment/pull/57>
496
+
497
+ #**Closed issues:**
498
+ - N/a
499
+
500
+ # v2.6.0
501
+
502
+ **Implemented enhancements:**
503
+ - [Resolves #26] Support configuration for skip checking of schema existence before switching
504
+ - [Resolves #41] Add tenant info to console boot
505
+
506
+ **Fixed bugs:**
507
+ - [Resolves #37] Custom Console deprecation warning
508
+ - [Resolves #42] After switch callback not working with nil argument
509
+
510
+ #**Closed issues:**
511
+ - Updated github actions configuration to run on PRs as well
512
+
513
+ # v2.5.0
514
+
515
+ **Implemented enhancements:**
516
+ - [Resolves #6] Adds support for rails 6.1
517
+ - [Resolves #27] Adds support to not rely on set search path, but instead prepends the schema name to the table name when using postgresql with schemas.
518
+ - [Resolves #35] Cache keys are now tenant dependent
519
+
520
+ **Fixed bugs:**
521
+ - [Resolves #27] Manually switching connection between read and write forgets the schema
522
+
523
+ #**Closed issues:**
524
+ - [Resolves #31] Add latest ruby versions to test matrix
525
+
526
+ # v2.4.0
527
+
528
+ **Implemented enhancements:**
529
+ - [Resolves #14] Add console info about tenants and fast switches #17
530
+ - Skip init if we're running webpacker:compile #18
531
+
532
+ **Fixed bugs:**
533
+ - Don't crash when no database connection is present #16
534
+ - Rescuing ActiveRecord::NoDatabaseError when dropping tenants #19
535
+
536
+ #**Closed issues:**
537
+ - Rakefile should use mysql port from configuration #5
538
+ - [Resolves #9] Cleanup rubocop todo #8
539
+ - Cleanup travis matrix #23
540
+
541
+ # v2.3.0
542
+ * January 3, 2020
543
+
544
+ **Implemented enhancements:**
545
+ - Basic support for rails 6
546
+ - Released different gem name, with same API as apartment
547
+
548
+ # v2.2.1
549
+ * June 19, 2019
550
+
551
+ **Implemented enhancements:**
552
+ - #566: IGNORE_EMPTY_TENANTS environment variable to ignore empty tenants
553
+ warning. [Pysis868]
554
+
555
+ **Fixed bugs:**
556
+ - #586: Ignore `CREATE SCHEMA public` statement in pg dump [artemave]
557
+ - #549: Fix Postgres schema creation with dump SQL [ancorcruz]
558
+
559
+ # v2.2.0
560
+ * April 14, 2018
561
+
562
+ **Implemented enhancements:**
563
+ - #523: Add Rails 5.2 support [IngusSkaistkalns]
564
+ - #504: Test against Ruby 2.5.0 [ahorek]
565
+ - #528: Test against Rails 5.2 [meganemura]
566
+
567
+ **Removed:**
568
+ - #504: Remove Rails 4.0/4.1 support [ahorek]
569
+ - #545: Stop supporting for JRuby + Rails 5.0 [meganemura]
570
+
571
+ **Fixed bugs:**
572
+ - #537: Fix PostgresqlSchemaFromSqlAdapter for newer PostgreSQL [shterrett]
573
+ - #532: Issue is reported by [aldrinmartoq]
574
+ - #519: Fix exception when main database doesn't exist [mayeco]
575
+
576
+ **Closed issues:**
577
+
578
+ - #514: Fix typo [menorval]
579
+
580
+ # v2.1.0
581
+ * December 15, 2017
582
+
583
+ - Add `parallel_migration_threads` configuration option for running migrations
584
+ in parallel [ryanbrunner]
585
+ - Drop Ruby 2.0.0 support [meganemura]
586
+ - ignore_private when parsing subdomains with PublicSuffix [michiomochi]
587
+ - Ignore row_security statements in psql dumps for backward compatibility
588
+ [meganemura]
589
+ - "Host" elevator [shrmnk]
590
+ - Enhance db:drop task to act on all tenants [kuzukuzu]
591
+
592
+ # v2.0.0
593
+ * July 26, 2017
594
+
595
+ - Raise FileNotFound rather than abort when loading files [meganemura]
596
+ - Add 5.1 support with fixes for deprecations [meganemura]
597
+ - Fix tests for 5.x and a host of dev-friendly improvements [meganemura]
598
+ - Keep query cache config after switching databases [fernandomm]
599
+ - Pass constants not strings to middleware stack (Rails 5) [tzabaman]
600
+ - Remove deprecations from 1.0.0 [caironoleto]
601
+ - Replace `tld_length` configuration option with PublicSuffix gem for the
602
+ subdomain elevator [humancopy]
603
+ - Pass full config to create_database to allow :encoding/:collation/etc
604
+ [kakipo]
605
+ - Don't retain a connection during initialization [mikecmpbll]
606
+ - Fix database name escaping in drop_command [mikecmpbll]
607
+ - Skip initialization for assets:clean and assets:precompile tasks
608
+ [frank-west-iii]
609
+
610
+ # v1.2.0
611
+ * July 28, 2016
612
+
613
+ - Official Rails 5 support
614
+
615
+ # v1.1.0
616
+ * May 26, 2016
617
+
618
+ - Reset tenant after each request
619
+ - [Support callbacks](https://github.com/influitive/apartment/commit/ff9c9d092a781026502f5997c0bbedcb5748bc83) on switch [cbeer]
620
+ - Preliminary support for [separate database hosts](https://github.com/influitive/apartment/commit/abdffbf8cd9fba87243f16c86390da13e318ee1f) [apneadiving]
621
+
622
+ # v1.0.2
623
+ * July 2, 2015
624
+
625
+ - Fix pg_dump env vars - pull/208 [MitinPavel]
626
+ - Allow custom seed data file - pull/234 [typeoneerror]
627
+
628
+ # v1.0.1
629
+ * April 28, 2015
630
+
631
+ - Fix `Apartment::Deprecation` which was rescuing all exceptions
632
+
633
+ # v1.0.0
634
+ * Feb 3, 2015
635
+
636
+ - [BREAKING CHANGE] `Apartment::Tenant.process` is deprecated in favour of `Apartment::Tenant.switch`
637
+ - [BREAKING CHANGE] `Apartment::Tenant.switch` without a block is deprecated in favour of `Apartment::Tenant.switch!`
638
+ - Raise proper `TenantNotFound`, `TenantExists` exceptions
639
+ - Deprecate old `SchemaNotFound`, `DatabaseNotFound` exceptions
640
+
641
+ # v0.26.1
642
+ * Jan 13, 2015
643
+
644
+ - Fixed [schema quoting bug](https://github.com/influitive/apartment/issues/198#issuecomment-69782651) [jonsgreen]
645
+
646
+ # v0.26.0
647
+ * Jan 5, 2015
648
+
649
+ - Rails 4.2 support
650
+
651
+ # v0.25.2
652
+ * Sept 8, 2014
653
+
654
+ - Heroku fix on `assets:precompile` - pull/169 [rabbitt]
655
+
656
+ # v0.25.1
657
+ * July 17, 2014
658
+
659
+ - Fixed a few vestiges of Apartment::Database
660
+
661
+ # v0.25.0
662
+ * July 3, 2014
663
+
664
+ - [BREAKING CHANGE] - `Apartment::Database` is not deprecated in favour of
665
+ `Apartment::Tenant`
666
+ - ActiveRecord (and Rails) 4.1 now supported
667
+ - A new sql based adapter that dumps the schema using sql
668
+
669
+ # v0.24.3
670
+ * March 5, 2014
671
+
672
+ - Rake enhancements weren't removed from the generator template
673
+
674
+ # v0.24.2
675
+ * February 24, 2014
676
+
677
+ - Better warnings if `apartment:migrate` is run
678
+
679
+ # v0.24.1
680
+ * February 21, 2014
681
+
682
+ - requiring `apartment/tasks/enhancements` in an initializer doesn't work
683
+ - One can disable tenant migrations using `Apartment.db_migrate_tenants = false` in the Rakefile
684
+
685
+ # v0.24
686
+ * February 21, 2014 (In honour of the Women's Gold Medal in Hockey at Sochi)
687
+
688
+ - [BREAKING CHANGE] `apartment:migrate` task no longer depends on `db:migrate`
689
+ - Instead, you can `require 'apartment/tasks/enhancements'` in your Apartment initializer
690
+ - This will enhance `rake db:migrate` to also run `apartment:migrate`
691
+ - You can now forget about ever running `apartment:migrate` again
692
+ - Numerous deprecations for things referencing the word 'database'
693
+ - This is an ongoing effort to completely replace 'database' with 'tenant' as a better abstraction
694
+ - Note the obvious `Apartment::Database` still exists but will hopefully become `Apartment::Tenant` soon
695
+
696
+ # v0.23.2
697
+ * January 9, 2014
698
+
699
+ - Increased visibility of #parse_database_name warning
700
+
701
+ # v0.23.1
702
+ * January 8, 2014
703
+
704
+ - Schema adapters now initialize with default and persistent schemas
705
+ - Deprecated Apartment::Elevators#parse_database_name
706
+
707
+ # v0.23.0
708
+ * August 21, 2013
709
+
710
+ - Subdomain Elevator now allows for exclusions
711
+ - Delayed::Job has been completely removed
712
+
713
+ # v0.22.1
714
+ * August 21, 2013
715
+
716
+ - Fix bug where if your ruby process importing the database schema is run
717
+ from a directory other than the app root, Apartment wouldn't know what
718
+ schema_migrations to insert into the database (Rails only)
719
+
720
+ # v0.22.0
721
+ * June 9, 2013
722
+
723
+ - Numerous bug fixes:
724
+ - Mysql reset could connect to wrong database [eric88]
725
+ - Postgresql schema names weren't quoted properly [gdott9]
726
+ - Fixed error message on SchemaNotFound in `process`
727
+ - HostHash elevator allows mapping host based on hash contents [gdott9]
728
+ - Official Sidekiq support with the [apartment-sidekiq gem](https://github.com/influitive/apartment-sidekiq)
729
+
730
+
731
+ # v0.21.1
732
+ * May 31, 2013
733
+
734
+ - Clearing the AR::QueryCache after switching databases.
735
+ - Fixes issue with stale model being loaded for schema adapters
736
+
737
+ # v0.21.0
738
+ * April 24, 2013
739
+
740
+ - JDBC support!! [PetrolMan]
741
+
742
+ # v0.20.0
743
+ * Feb 6, 2013
744
+
745
+ - Mysql now has a 'schema like' option to perform like Postgresql (default)
746
+ - This should be significantly more performant than using connections
747
+ - Psych is now supported for Delayed::Job yaml parsing
748
+
749
+ # v0.19.2
750
+ * Jan 30, 2013
751
+
752
+ - Database schema file can now be set manually or skipped altogether
753
+
754
+ # v0.19.1
755
+ * Jan 30, 2013
756
+
757
+ - Allow schema.rb import file to be specified in config or skip schema.rb import altogether
758
+
759
+ # v0.19.0
760
+ * Dec 29, 2012
761
+
762
+ - Apartment is now threadsafe
763
+ - New postgis adapter [zonpantli]
764
+ - Removed ActionDispatch dependency for use with Rack apps (regression)
765
+
766
+ # v0.18.0
767
+ * Nov 27, 2012
768
+
769
+ - Added `append_environment` config option [virtualstaticvoid]
770
+ - Cleaned up the readme and generator documentation
771
+ - Added `connection_class` config option [smashtank]
772
+ - Fixed a [bug](https://github.com/influitive/apartment/issues/17#issuecomment-10758327) in pg adapter when missing schema
773
+
774
+ # v0.17.1
775
+ * Oct 30, 2012
776
+
777
+ - Fixed a bug where switching to an unknown db in mysql2 would crash the app [Frodotus]
778
+
779
+ # v0.17.0
780
+ * Sept 26, 2012
781
+
782
+ - Apartment has [a new home!](https://github.com/influitive/apartment)
783
+ - Support Sidekiq hooks to switch dbs [maedhr]
784
+ - Allow VERSION to be used on apartment:migrate [Bhavin Kamani]
785
+
786
+ # v0.16.0
787
+ * June 1, 2012
788
+
789
+ - Apartment now supports a default_schema to be set, rather than relying on ActiveRecord's default schema_search_path
790
+ - Additional schemas can always be maintained in the schema_search_path by configuring persistent_schemas [ryanbrunner]
791
+ - This means Hstore is officially supported!!
792
+ - There is now a full domain based elevator to switch dbs based on the whole domain [lcowell]
793
+ - There is now a generic elevator that takes a Proc to switch dbs based on the return value of that proc.
794
+
795
+ # v0.15.0
796
+ * March 18, 2012
797
+
798
+ - Remove Rails dependency, Apartment can now be used with any Rack based framework using ActiveRecord
799
+
800
+ # v0.14.4
801
+ * March 8, 2012
802
+
803
+ - Delayed::Job Hooks now return to the previous database, rather than resetting
804
+
805
+ # v0.14.3
806
+ * Feb 21, 2012
807
+
808
+ - Fix yaml serialization of non DJ models
809
+
810
+ # v0.14.2
811
+ * Feb 21, 2012
812
+
813
+ - Fix Delayed::Job yaml encoding with Rails > 3.0.x
814
+
815
+ # v0.14.1
816
+ * Dec 13, 2011
817
+
818
+ - Fix ActionDispatch::Callbacks deprecation warnings
819
+
820
+ # v0.14.0
821
+ * Dec 13, 2011
822
+
823
+ - Rails 3.1 Support
824
+
825
+ # v0.13.1
826
+ * Nov 8, 2011
827
+
828
+ - Reset prepared statement cache for rails 3.1.1 before switching dbs when using postgresql schemas
829
+ - Only necessary until the next release which will be more schema aware
830
+
831
+ # v0.13.0
832
+ * Oct 25, 2011
833
+
834
+ - `process` will now rescue with reset if the previous schema/db is no longer available
835
+ - `create` now takes an optional block which allows you to process within the newly created db
836
+ - Fixed Rails version >= 3.0.10 and < 3.1 because there have been significant testing problems with 3.1, next version will hopefully fix this
837
+
838
+ # v0.12.0
839
+ * Oct 4, 2011
840
+
841
+ - Added a `drop` method for removing databases/schemas
842
+ - Refactored abstract adapter to further remove duplication in concrete implementations
843
+ - Excluded models now take string references so they are properly reloaded in development
844
+ - Better silencing of `schema.rb` loading using `verbose` flag
845
+
846
+ # v0.11.1
847
+ * Sep 22, 2011
848
+
849
+ - Better use of Railties for initializing apartment
850
+ - The following changes were necessary as I haven't figured out how to properly hook into Rails reloading
851
+ - Added reloader middleware in development to init Apartment on each request
852
+ - Override `reload!` in console to also init Apartment
853
+
854
+ # v0.11.0
855
+ * Sep 20, 2011
856
+
857
+ - Excluded models no longer use a different connection when using postgresql schemas. Instead their table_name is prefixed with `public.`
858
+
859
+ # v0.10.3
860
+ * Sep 20, 2011
861
+
862
+ - Fix improper raising of exceptions on create and reset
863
+
864
+ # v0.10.2
865
+ * Sep 15, 2011
866
+
867
+ - Remove all the annoying logging for loading db schema and seeding on create
868
+
869
+ # v0.10.1
870
+ * Aug 11, 2011
871
+
872
+ - Fixed bug in DJ where new objects (that hadn't been pulled from the db) didn't have the proper database assigned
873
+
874
+ # v0.10.0
875
+ * July 29, 2011
876
+
877
+ - Added better support for Delayed Job
878
+ - New config option that enables Delayed Job wrappers
879
+ - Note that DJ support uses a work-around in order to get queues stored in the public schema, not sure why it doesn't work out of the box, will look into it, until then, see documentation on queue'ng jobs
880
+
881
+ # v0.9.2
882
+ * July 4, 2011
883
+
884
+ - Migrations now run associated rails migration fully, fixes schema.rb not being reloaded after migrations
885
+
886
+ # v0.9.1
887
+ * June 24, 2011
888
+
889
+ - Hooks now take the payload object as an argument to fetch the proper db for DJ hooks
890
+
891
+ # v0.9.0
892
+ * June 23, 2011
893
+
894
+ - Added module to provide delayed job hooks
895
+
896
+ # v0.8.0
897
+ * June 23, 2011
898
+
899
+ - Added #current_database which will return the current database (or schema) name
900
+
901
+ # v0.7.0
902
+ * June 22, 2011
903
+
904
+ - Added apartment:seed rake task for seeding all dbs
905
+
906
+ # v0.6.0
907
+ * June 21, 2011
908
+
909
+ - Added #process to connect to new db, perform operations, then ensure a reset
910
+
911
+ # v0.5.1
912
+ * June 21, 2011
913
+
914
+ - Fixed db migrate up/down/rollback
915
+ - added db:redo
916
+
917
+ # v0.5.0
918
+ * June 20, 2011
919
+
920
+ - Added the concept of an "Elevator", a rack based strategy for db switching
921
+ - Added the Subdomain Elevator middleware to enabled db switching based on subdomain
922
+
923
+ # v0.4.0
924
+ * June 14, 2011
925
+
926
+ - Added `configure` method on Apartment instead of using yml file, allows for dynamic setting of db names to migrate for rake task
927
+ - Added `seed_after_create` config option to import seed data to new db on create
928
+
929
+ # v0.3.0
930
+ * June 10, 2011
931
+
932
+ - Added full support for database migration
933
+ - Added in method to establish new connection for excluded models on startup rather than on each switch
934
+
935
+ # v0.2.0
936
+ * June 6, 2011 *
937
+
938
+ - Refactor to use more rails/active_support functionality
939
+ - Refactor config to lazily load apartment.yml if exists
940
+ - Remove OStruct and just use hashes for fetching methods
941
+ - Added schema load on create instead of migrating from scratch
942
+
943
+ # v0.1.3
944
+ * March 30, 2011 *
945
+
946
+ - Original pass from Ryan
947
+
948
+
949
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*