Skip to content

Support Ruby 3.2–4.0 and Rails 6.1–8.1 - #56

Merged
parndt merged 14 commits into
masterfrom
rails-8-compat
Nov 17, 2026
Merged

parndt merged 14 commits into
masterfrom
rails-8-compat

Conversation

@parndt

@parndt parndt commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

This brings the extension up to date with refinerycms main and gets the CI matrix green across Ruby 3.2–4.0 and Rails 6.1, 7.2, 8.0 and 8.1, on sqlite, MySQL and Postgres.

The Gemfile now tracks refinerycms main rather than master, and takes the Rails version from RAILS_VERSION. On Rails 8.0 and earlier, json stays below 3, because ActiveSupport still passes quirks_mode to JSON.generate and json 3 rejects it. For Ruby 3.4, older Rails gets mutex_m back, and the Rakefile requires logger and uses File.exist?.

Two fixes were needed for newer Rails and rspec. The admin UsersController has no show action, but crudify registered a find callback for it, which Rails 7.1+ refuses; passing exclude_from_find: :show sorts that out. In the specs, rspec-core 3.13 applies config.extend before config.include, so including Devise::Test::ControllerHelpers from ControllerMacros.extended ran before rspec-rails had defined setup. It's now included through config.include instead.

The password-reset specs were also failing because core's _error_messages partial dropped the attribute name, showing "is invalid" rather than "Reset password token is invalid". That was fixed in refinery/refinerycms#3540, which has now merged.

Finally, there's a trusted-publishing release workflow, so pushing a v* tag builds the gem and publishes it to RubyGems.org. It runs in the release environment, which only v* tags can deploy to.

Closes #51

parndt added 5 commits May 14, 2026 15:41
- Switch from git source to released gem refinerycms 4.1.0
- Add mutex_m, base64, bigdecimal, observer for Ruby 3.4 stdlib extractions
- Fix File.exists? -> File.exist? (removed in Ruby 3.2)
- Add require 'logger' to Rakefile for Ruby 3.4
- Cover Rails 6.1 (legacy, Ruby 3.2–3.3) and 7.2–8.1 (modern, Ruby 3.2–4.0)
  in one matrix with excludes, mirroring refinery/refinerycms
- Gemfile uses refinerycms git main for Rails 7.2+ and 4.1.0 for Rails 6.1
- Add sqlite3 to modern matrix; exclude it for Rails 6.1 (version conflict)
- Exclude Ruby 3.4/4.0 with Rails 6.1 (not compatible)
- mutex_m needed for Ruby 3.4 with Rails 6/7 (extracted from stdlib)
- actions/checkout@v6, drop max-parallel cap
rspec-core 3.13 applies config.extend before config.include, so including
Devise::Test::ControllerHelpers from ControllerMacros.extended ran before
rspec-rails had added `setup` to the example group.
UsersController has no show action. Rails 7.1+ raises on callbacks whose
:only lists a missing action (raise_on_missing_callback_actions), which
broke every admin users request in development and test.
json 3 rejects the quirks_mode option that Rails 6.1 passes to
JSON.generate, which broke every request in the 6.1 feature specs.
Points Rails 7.2+ at refinery/refinerycms#3540 (b2d9fed) so the password
reset specs prove the fix. Return to branch: "main" once it merges.
ActiveSupport up to 8.0 passes quirks_mode to JSON.generate, which json 3
rejects.
The released 4.1.0 renders validation errors without the attribute name,
which breaks the password reset specs. Core main supports Rails 6.1+, so
use it everywhere.
parndt added a commit to refinery/refinerycms that referenced this pull request Nov 9, 2026
When #3518 moved to the Rails 7 errors API, both branches of
`refinery/admin/_error_messages` started rendering `error.message`. The
`include_object_name` branch used to render `full_messages`, so forms
now show "can't be blank" instead of "Title can't be blank". 4.1.0
shipped with this.

`include_object_name: true` is used by `crudify`, the pages and images
admin, and the engine generator's `_form` template. The generator's spec
template expects `"Title can't be blank"`, so newly generated extensions
fail their own feature specs. It also breaks two password-reset specs in
refinerycms-authentication-devise
(refinery/refinerycms-authentication-devise#56).

## Change

- Render `error.full_message` in the `include_object_name` branch
- Add a pages admin system spec that saves a page with a blank title and
expects "Title can't be blank". It fails without the change.
refinerycms resolves decorators 2.1, which supports Rails 7.2+.
The RubyGems trusted publisher is scoped to it, and the environment only
allows v* tags to deploy.
Pushing a v* tag builds the gem with `gem build` and publishes it to
RubyGems.org through trusted publishing, so no API key is stored.
Released decorators caps railties below 7.2, so the modern Rails matrix
cannot resolve. refinerycms main uses the same branch.
@parndt
parndt merged commit efd2bf6 into master Nov 17, 2026
40 checks passed
@parndt
parndt deleted the rails-8-compat branch November 17, 2026 22:35
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.

Release a new gem version

1 participant