Skip to content

Commit fcca0df

Browse files
committed
add Rails 8.1 into CI
1 parent 916df5f commit fcca0df

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- "truffleruby"
2929
gemfile:
3030
- "rails-edge"
31+
- "rails-8.1"
3132
- "rails-8.0"
3233
- "rails-7.2"
3334
- "rails-7.1"
@@ -49,6 +50,17 @@ jobs:
4950
- gemfile: "rails-edge"
5051
ruby-version: "2.5"
5152

53+
- gemfile: "rails-8.1"
54+
ruby-version: "3.1"
55+
- gemfile: "rails-8.1"
56+
ruby-version: "3.0"
57+
- gemfile: "rails-8.1"
58+
ruby-version: "2.7"
59+
- gemfile: "rails-8.1"
60+
ruby-version: "2.6"
61+
- gemfile: "rails-8.1"
62+
ruby-version: "2.5"
63+
5264
- gemfile: "rails-8.0"
5365
ruby-version: "3.1"
5466
- gemfile: "rails-8.0"

gemfiles/rails-8.0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 8.0.0.pre'
3+
gem 'rails', '~> 8.0.0'
44
gem 'sidekiq', '>= 7.3.0', require: false
55

66
gem 'logtail'

gemfiles/rails-8.1.gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rails', '~> 8.1.0'
4+
gem 'sidekiq', '>= 7.3.0', require: false
5+
6+
gem 'logtail'
7+
gem 'logtail-rack'
8+
gem "sqlite3", ">= 2.0"
9+
10+
gemspec :path => '../'

lib/logtail-rails/active_support_log_subscriber.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def unsubscribe!(component, type)
2626
subscriber = find(component, type)
2727

2828
if !subscriber
29+
# In Rails 8.1+, the default log subscriber might not be attached yet
30+
return if ::Rails::VERSION::MAJOR > 8 || (::Rails::VERSION::MAJOR == 8 && ::Rails::VERSION::MINOR >= 1)
31+
2932
raise "We could not find a log subscriber for #{component.inspect} of type #{type.inspect}"
3033
end
3134

0 commit comments

Comments
 (0)