Skip to content

Commit

Permalink
Add support for activerecord 7.2, ruby 3.3 (#35)
Browse files Browse the repository at this point in the history
## What did we change?

- Bump dependency requirements so that this gem is compatible with ActiveRecord 7.2
- Test against ActiveRecord 7.2
- Test against Ruby 3.3

## Why are we doing this?

Resolves #34 so that people who are using rails 7.2 can also use this gem.

## NOTES

Ruby 3.0 has been EOL for almost 5 months. I figure that a breaking change for dropping this probably warrants a separate release. Rails 6.1 is EOL in 2 weeks, so it probably makes sense to drop support for that simultaneously.
  • Loading branch information
jmpage authored Sep 17, 2024
1 parent 92e3c53 commit 0b795f7
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ jobs:
strategy:
fail-fast: false
matrix:
activerecord: [ '6.1', '7.0', '7.1' ]
ruby: [ '3.0', '3.1', '3.2' ]
activerecord: [ '6.1', '7.0', '7.1', '7.2' ]
ruby: [ '3.0', '3.1', '3.2', '3.3' ]
exclude:
- activerecord: '7.2'
ruby: '3.0'
timeout-minutes: 10
needs:
- lint
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ end
appraise "activerecord_7.1" do
gem "activerecord", ">= 7.1.0", "< 7.2"
end

appraise "activerecord_7.2" do
gem "activerecord", ">= 7.2.0", "< 7.3"
end
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# activerecord-postgres_pub_sub

## v3.1.0
- Add support for ActiveRecord 7.2
- Add support for Ruby 3.3

## v3.0.0
- Add support for multiple databases by allowing injection of the base Active Record class.
- BREAKING: Drop support for ActiveRecord 5.2, 6.0
Expand Down
2 changes: 1 addition & 1 deletion activerecord-postgres_pub_sub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 3.0.0"

spec.add_runtime_dependency "activerecord", "> 6.0", "< 7.2"
spec.add_runtime_dependency "activerecord", "> 6.0", "< 7.3"
spec.add_runtime_dependency "pg", "~> 1.1"
spec.add_runtime_dependency "private_attr"
spec.add_runtime_dependency "with_advisory_lock"
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/activerecord_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", ">= 7.2.0", "< 7.3"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/activerecord/postgres_pub_sub/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module ActiveRecord
module PostgresPubSub
VERSION = "3.0.0"
VERSION = "3.1.0"
end
end
6 changes: 4 additions & 2 deletions spec/active_record/postgres_pub_sub/listener_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "ostruct"

RSpec.describe ActiveRecord::PostgresPubSub::Listener, cleaner_strategy: :truncation do
let(:channel) { "pub_sub_test" }
let(:base_class) { ActiveRecord::Base }
Expand All @@ -17,7 +19,7 @@
Thread.new do
listener_loop(**listener_options)
ensure
base_class.clear_active_connections!
base_class.connection_handler.clear_active_connections!
end
end

Expand Down Expand Up @@ -48,7 +50,7 @@
end
end
ensure
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.connection_handler.clear_active_connections!
end
end

Expand Down

0 comments on commit 0b795f7

Please sign in to comment.