Skip to content

Conversation

@y-yagi
Copy link
Collaborator

@y-yagi y-yagi commented Nov 1, 2025

Description

This PR creates to support Rails 8.1.

  • Add Rails 8.1 to the CI matrix 462f95e
  • Remove using Codec Climate b63430d
  • Enforce to disable ActiveSupport::ExecutionContext.nestable 0bcbbad
    • ActiveSupport::ExecutionContext.nestable would be true when ActiveSupport::TestCase is loaded. https://github.com/rails/rails/blob/b47cc51b989e09e8a00616bc336c8da7347a90d5/activesupport/lib/active_support/railtie.rb#L68 We load action_controller/test_case in Rails console, so this would be true.
       * But, it looks like ``ActiveSupport::ExecutionContext.nestableonly consider to enable on test environment. That cause unexpected behavior. To avoid an error, enforce to disable it.  * To be honest, usingaction_controller/test_case` isn't good idea I think. It's better to have a dummy request class by draper own. But I keep it to simple the PR.
  • Temporary use my fork and latest code for test 14d85cc
    • Unfortunatelly, released mongoid and rspec-activerecord-expectations don't support Rails 8.1 yet. So using fork and the latest code to run tests.

To-Dos

  • fixes

References

#948

@y-yagi
Copy link
Collaborator Author

y-yagi commented Nov 2, 2025

The specs for Rails 8.1 are failed because of jmmastey/rspec-activerecord-expectations#3

Alexander-Senko
Alexander-Senko previously approved these changes Nov 2, 2025
`ActiveSupport::ExecutionContext.nestable` would be true when
`ActiveSupport::TestCase` is loaded.
https://github.com/rails/rails/blob/b47cc51b989e09e8a00616bc336c8da7347a90d5/activesupport/lib/active_support/railtie.rb#L68

We load `action_controller/test_case` in Rails console, so this
would be true.

But, it looks like ``ActiveSupport::ExecutionContext.nestable`
only consider to enable on test environment. That cause unexpected
behavior. To avoid an error, enforce to disable it.

Fixes drapergem#948.
@y-yagi y-yagi force-pushed the support_rails81 branch 2 times, most recently from d91f1ec to 65e9004 Compare November 2, 2025 23:27
@y-yagi y-yagi marked this pull request as ready for review November 4, 2025 09:36
Alexander-Senko
Alexander-Senko previously approved these changes Nov 4, 2025
@y-yagi y-yagi merged commit 7f3e7c6 into drapergem:master Nov 5, 2025
15 of 16 checks passed
@y-yagi y-yagi deleted the support_rails81 branch November 5, 2025 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants