From 3e1f7d0837025c50147740895a17c5a7007ec7f8 Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Thu, 1 Oct 2026 14:15:29 +0200 Subject: [PATCH 1/3] fix: require the delegation core ext before rails/railtie On Rails 8.1 requiring this gem raises NoMethodError: undefined method 'delegate_missing_to' for class Rails::Initializable::Collection railties 8.1 calls delegate_missing_to in the body of Rails::Initializable::Collection, but rails/initializable.rb only requires "tsort" and rails/railtie.rb requires rails/initializable before any ActiveSupport core ext. This gem requires "rails/railtie" directly, so it is the first thing to load that file and it trips over the missing method. Reproducible with no ActiveAdmin in the picture: # railties 8.1.4 ruby -e 'require "rails/railtie"' -> NoMethodError ruby -e 'require "active_support/core_ext/module/delegation"; require "rails/railtie"' -> OK # railties 8.0.5.1 ruby -e 'require "rails/railtie"' -> OK This is a user-facing bug, not a CI detail: the gemspec allows rails >= 7.2, < 9, so every host app on Rails 8.1 crashes on require. Fixed by requiring the single core ext railties forgot, which preserves the existing intent of loading only the minimal Railtie base class rather than all of Rails -- requiring "rails" or "active_support/rails" would both pull in far more. No new spec: all four suites require the gem via spec_helper, so each one already fails outright on Rails 8.1 without this change. --- lib/activeadmin-oidc.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/activeadmin-oidc.rb b/lib/activeadmin-oidc.rb index 7086095..fc74f40 100644 --- a/lib/activeadmin-oidc.rb +++ b/lib/activeadmin-oidc.rb @@ -18,6 +18,17 @@ # at file load, so pull in the minimal Railtie base class first — this # keeps the require safe even in spec_helper contexts where the full # Rails stack hasn't been initialized yet. +# +# The delegation core ext has to come first. railties 8.1's +# `rails/initializable.rb` calls `delegate_missing_to` in the body of +# `Rails::Initializable::Collection` but only requires "tsort", and +# `rails/railtie.rb` requires `rails/initializable` before any +# ActiveSupport core ext. So on Rails 8.1 a bare `require +# "rails/railtie"` raises `NoMethodError: undefined method +# 'delegate_missing_to'`. Requiring the one core ext it needs keeps the +# intent above intact — we still load only the minimal Railtie base +# class, not all of Rails. +require "active_support/core_ext/module/delegation" require "rails/railtie" require "omniauth/rails_csrf_protection" From 18442adcc8c7e3925b79d3889c7350695e0f44bf Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Thu, 1 Oct 2026 14:15:53 +0200 Subject: [PATCH 2/3] chore: move the ActiveAdmin 4.0 gemfile to Rails 8.1 Now that the gem loads on Rails 8.1 the AA 4.0 leg can test it. Rails 8.0 goes EOL on 2026-11-07 (endoflife.date/rails); 8.1 is supported until 2027-10-10, so this gives the repo a long-lived Rails leg. gemfiles/activeadmin_3.5.gemfile deliberately stays on "~> 8.0.0" so both currently supported Rails series are still covered. The pin stays three-segment: a two-segment "~> 8.1" would mean >= 8.1, < 9.0 and would drift onto 8.2 once that ships, so the leg would stop testing the version it names. Note on merge order: PR #22 adds a comment above this pin naming the Rails 8.1 blocker that this branch fixes. This branch is cut from main, where that comment does not exist yet. If #22 merges first, rebase and delete that now-stale comment. --- gemfiles/activeadmin_4.0.gemfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gemfiles/activeadmin_4.0.gemfile b/gemfiles/activeadmin_4.0.gemfile index f649b68..0291e56 100644 --- a/gemfiles/activeadmin_4.0.gemfile +++ b/gemfiles/activeadmin_4.0.gemfile @@ -8,10 +8,7 @@ gemspec path: ".." # the Sprockets/Sassc pipeline with Propshaft + importmap + cssbundling + # Tailwind, so the asset gems differ entirely from the 3.5 gemfile. gem "activeadmin", ">= 4.0.0.beta", "< 5" -# Blocked on Rails 8.1: railties 8.1 calls `delegate_missing_to` in -# Rails::Initializable::Collection without requiring the ActiveSupport -# core ext, so this gem's `require "rails/railtie"` raises NoMethodError. -gem "rails", "~> 8.0.0" +gem "rails", "~> 8.1.0" # openid_connect 2.x line (faraday 2.x). gem "omniauth_openid_connect", "~> 0.8.0" From c6516344c19e5becf796caa12145ae4d38695e37 Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Thu, 1 Oct 2026 14:18:45 +0200 Subject: [PATCH 3/3] chore: drop the json < 3 pin from the ActiveAdmin 4.0 gemfile The pin worked around json 3.0 removing the `quirks_mode` keyword that ActiveSupport::JSON passed to JSON.parse/JSON.generate. activesupport 8.1 no longer passes it -- `quirks_mode` does not appear anywhere in activesupport 8.1.4's lib/, while 7.2.3 and 8.0.5.1 both pass it in lib/active_support/json/{decoding,encoding}.rb. Now that this gemfile is on Rails 8.1 the workaround is dead weight. Verified rather than assumed: with the pin removed and no lockfile (as on CI) bundler resolves json 3.0.2, and all four suites pass on Ruby 3.4.10 -- 161, 7, 8 and 6 examples, 0 failures, no "unknown keyword: quirks_mode" anywhere. gemfiles/activeadmin_3.5.gemfile keeps its pin and its comment: that leg runs an older activesupport, which still passes the keyword. Removing the pin there resolves json 3.0.2 and produces 59 failures. --- gemfiles/activeadmin_4.0.gemfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gemfiles/activeadmin_4.0.gemfile b/gemfiles/activeadmin_4.0.gemfile index 0291e56..3a963d1 100644 --- a/gemfiles/activeadmin_4.0.gemfile +++ b/gemfiles/activeadmin_4.0.gemfile @@ -17,7 +17,3 @@ gem "propshaft" gem "importmap-rails" gem "cssbundling-rails" gem "tailwindcss-rails", "~> 4.0" - -# See the note in activeadmin_3.5.gemfile: json 3.0 removed the -# `quirks_mode` keyword ActiveSupport::JSON still passes. -gem "json", "< 3"