diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2c1ba59..3251683b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: - 3.2 - 3.1 rails: + - 8.1 - 8.0 - 7.2 include: @@ -39,6 +40,7 @@ jobs: - { ruby: '2.4', rails: '5' } exclude: - { ruby: '3.1', rails: '8.0' } + - { ruby: '3.1', rails: '8.1' } env: RAILS_VERSION: "${{ matrix.rails }}" @@ -59,12 +61,8 @@ jobs: rubygems: latest bundler-cache: true - - name: RSpec & publish code coverage - uses: paambaati/codeclimate-action@v8 - env: - CC_TEST_REPORTER_ID: b7ba588af2a540fa96c267b3655a2afe31ea29976dc25905a668dd28d5e88915 - with: - coverageCommand: bin/rake + - name: RSpec + run: bin/rake continue-on-error: ${{ matrix.allow-fail }} id: test diff --git a/Gemfile b/Gemfile index 6d16aead..521884d0 100644 --- a/Gemfile +++ b/Gemfile @@ -28,8 +28,9 @@ else gem 'rails', "~> #{rails_version}.0" end +# FIXME: Remove the later condition after `mongoid` supports Rails 8.1 gem 'mongoid' unless - rails_version == 'edge' + rails_version == 'edge' || rails_version == '8.1' gem 'active_model_serializers' case RUBY_VERSION @@ -49,4 +50,10 @@ end if RUBY_VERSION < "3.0.0" gem "concurrent-ruby", "< 1.3.5" -end \ No newline at end of file +end + +# FIXME: Use releases gems after they support Rails 8.1 +if rails_version.to_s >= '8.1' + gem 'rspec-activerecord-expectations', github: 'y-yagi/rspec-activerecord-expectations', branch: 'support_rails81' + gem 'mongoid', github: 'mongodb/mongoid', ref: 'eac49f0' +end diff --git a/README.md b/README.md index bdb7053a..588434b3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Draper: View Models for Rails [![Actions Status](https://github.com/drapergem/draper/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/drapergem/draper/actions?query=workflow%3Aci+branch%3Amaster) -[![Code Climate](https://codeclimate.com/github/drapergem/draper.svg)](https://codeclimate.com/github/drapergem/draper) -[![Test Coverage](https://api.codeclimate.com/v1/badges/0d40c43951d516bf6985/test_coverage)](https://codeclimate.com/github/drapergem/draper/test_coverage) [![Inline docs](http://inch-ci.org/github/drapergem/draper.svg?branch=master)](http://inch-ci.org/github/drapergem/draper) Draper adds an object-oriented layer of presentation logic to your Rails diff --git a/lib/draper/railtie.rb b/lib/draper/railtie.rb index f5d25e0e..563f72c1 100644 --- a/lib/draper/railtie.rb +++ b/lib/draper/railtie.rb @@ -56,7 +56,12 @@ def initialize_view_context Draper::ViewContext.build end - console { initialize_view_context } + console do + initialize_view_context + if ActiveSupport.gem_version >= Gem::Version.new('8.1.0') + ActiveSupport::ExecutionContext.nestable = false + end + end runner { initialize_view_context }