Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/documentation-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Validate coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- name: Installing packages
Expand All @@ -40,7 +40,7 @@ jobs:
run: bundle exec bake utopia:project:static --force no

- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: docs

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:

ruby:
- "3.3"
- "3.4"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
Expand All @@ -34,7 +35,7 @@ jobs:
timeout-minutes: 5
run: bundle exec bake test

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v5
with:
name: coverage-${{matrix.os}}-${{matrix.ruby}}
path: .covered.db
Expand All @@ -44,13 +45,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
ruby-version: "3.4"
bundler-cache: true

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v5

- name: Validate coverage
timeout-minutes: 5
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ jobs:
- macos

ruby:
- "3.1"
- "3.2"
- "3.3"
- "3.4"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
- macos

ruby:
- "3.1"
- "3.2"
- "3.3"
- "3.4"

gemfile:
- gems/rails-v6.rb
- gems/rails-v7.rb
- gems/rails-v8.rb

experimental: [false]

Expand All @@ -46,7 +45,7 @@ jobs:
BUNDLE_GEMFILE: ${{matrix.gemfile}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
Expand Down
2 changes: 1 addition & 1 deletion console-adapter-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Gem::Specification.new do |spec|

spec.add_dependency "console", "~> 1.21"
spec.add_dependency "fiber-storage", "~> 1.0"
spec.add_dependency "rails", ">= 6.1"
spec.add_dependency "rails", ">= 7.0"
end
2 changes: 1 addition & 1 deletion gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
gem "bake-test"
gem "bake-test-external"

gem "sqlite3", "~> 1.4"
gem "sqlite3", ">= 1.4"
end
2 changes: 1 addition & 1 deletion gems/rails-v6.rb → gems/rails-v8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

eval_gemfile('../gems.rb')

gem 'rails', '~> 6.0'
gem 'rails', '~> 8.0'
22 changes: 15 additions & 7 deletions lib/console/adapter/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,31 @@ class Railtie < ::Rails::Railtie
initializer 'console.adapter.rails', before: :initialize_logger do |app|
# 1. Set up Console to be used as the Rails logger
Logger.apply!(configuration: app.config)

# 2. Remove the Rails::Rack::Logger middleware as it also doubles up on request logs
app.middleware.delete ::Rails::Rack::Logger
end

# 3. Remove existing log subscribers for ActionController and ActionView
config.after_initialize do
::ActionController::LogSubscriber.detach_from :action_controller

if ::ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber
::ActionController::LogSubscriber.detach_from :action_controller
else
::ActiveSupport.event_reporter.unsubscribe(::ActionController::LogSubscriber)
end

# Silence the default action view logs, e.g. "Rendering text template" etc
::ActionView::LogSubscriber.detach_from :action_view
if ::ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber
::ActionView::LogSubscriber.detach_from :action_view
else
::ActiveSupport.event_reporter.unsubscribe(::ActionView::LogSubscriber)
end
end

config.after_initialize do
# 4. Add a new log subscriber for ActionController
ActionController.apply!

# 5. (optionally) Add a new log subscriber for ActiveRecord
# ActiveRecord.apply!
end
Expand Down
Loading