From ae9ab1564e6248b5901ddf5993541a6f408c11ff Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Tue, 15 Sep 2026 09:57:24 -0500 Subject: [PATCH] Remove the global 'API' inflector acronym registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Process-global ActiveSupport::Inflector state, not scoped to this gem — requiring it inside a real host app (mozo-backend) broke Zeitwerk autoloading of anything with "Api" in its name (JsonApiRenderer camelized to JsonAPIRenderer instead, an uninitialized-constant error with no obvious connection to this gem). Not needed here anyway: autoload_default only ever goes constant name -> file path via #underscore, never the reverse, so this module's own naming never depended on it. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_0199wudpuAtkhouHKSEGxzpa --- lib/strike_me/api.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/strike_me/api.rb b/lib/strike_me/api.rb index 89b6664..c8bd203 100644 --- a/lib/strike_me/api.rb +++ b/lib/strike_me/api.rb @@ -14,10 +14,17 @@ require_relative 'btc_attribute_type' # require_relative 'api/base_model' # require_relative 'api/invoice_response' -ActiveSupport::Inflector.inflections(:en) { |inflect| inflect.acronym 'API' } - module StrikeMe module API + # Deliberately does NOT register 'API' as an ActiveSupport::Inflector + # acronym (used to, removed 2026-09-15) — that's process-global state, + # not scoped to this gem, and it broke Zeitwerk autoloading in a real + # host app (mozo-backend's JsonApiRenderer concern camelized to + # JsonAPIRenderer instead once this gem was required, an + # uninitialized-constant error with no obvious cause). Not needed + # here anyway: autoload_default below only ever goes constant name -> + # file path (via #underscore), never the reverse, so no inflection + # help is required for this module's own naming. class Error < StandardError; end def self.autoload_default(name)