Skip to content

Commit

Permalink
Remove support for Rails 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning committed Oct 12, 2023
1 parent 00595f2 commit 947564c
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 108 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
- "false"
- "true"
include:
- {ruby-version: "2.7", gemfile: rails5.1, legacy_connection_handling: "false"}
- {ruby-version: "2.7", gemfile: rails5.2, legacy_connection_handling: "false"}
- {ruby-version: "2.7", gemfile: rails6.0, legacy_connection_handling: "false"}
env:
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and as of v1.0.0 this project adheres to [Semantic Versioning](https://semver.or

- `Trilogy` is now a supported MySQL database adapter. ActiveRecordHostPool no longer requires `mysql2`, nor does it explicitly require `activerecord-trilogy-adapter`. Applications using ARHP will now need to explicitly require one of these adapters in its gemfile. When using `activerecord-trilogy-adapter` also ensure that the `trilogy` gem is locked to `v2.5.0+`.
- Remove `mysql2` as a direct dependency, test Rails 7.0 with `mysql2` and `activerecord-trilogy-adapter`.
- Remove support for Rails 5.1.

## [1.2.5] - 2023-07-14
### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

eval_gemfile 'gemfiles/rails5.1.gemfile'
eval_gemfile 'gemfiles/rails5.2.gemfile'
2 changes: 1 addition & 1 deletion active_record_host_pool.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Gem::Specification.new do |s|

s.required_ruby_version = ">= 2.7.0"

s.add_runtime_dependency("activerecord", ">= 5.1.0", "< 7.1")
s.add_runtime_dependency("activerecord", ">= 5.2.0", "< 7.1")
end
10 changes: 0 additions & 10 deletions gemfiles/rails5.1.gemfile

This file was deleted.

84 changes: 0 additions & 84 deletions gemfiles/rails5.1.gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rails5.2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
active_record_host_pool (1.2.5)
activerecord (>= 5.1.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails6.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
active_record_host_pool (1.2.5)
activerecord (>= 5.1.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails6.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
active_record_host_pool (1.2.5)
activerecord (>= 5.1.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails7.0_mysql2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
active_record_host_pool (1.2.5)
activerecord (>= 5.1.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails7.0_trilogy.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
active_record_host_pool (1.2.5)
activerecord (>= 5.1.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion lib/active_record_host_pool/connection_adapter_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ConnectionHandler

:noop

when '5.1', '5.2', '6.0'
when '5.2', '6.0'

def establish_connection(spec)
resolver = ConnectionAdapters::ConnectionSpecification::Resolver.new(Base.configurations)
Expand Down
6 changes: 1 addition & 5 deletions test/test_arhp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ def test_process_forking_with_connections

# Verify that when we fork, the process doesn't crash
pid = Process.fork do
if ActiveRecord.version >= Gem::Version.new('5.2')
assert_equal(false, ActiveRecord::Base.connected?) # New to Rails 5.2
else
assert_equal(true, ActiveRecord::Base.connected?)
end
refute ActiveRecord::Base.connected?
end
Process.wait(pid)
# Cleanup any connections we may have left around
Expand Down

0 comments on commit 947564c

Please sign in to comment.