Skip to content

[regression fix] Restore ActiveSupport::Concern class-method mapping - #447

Draft
apiology wants to merge 2 commits into
masterfrom
restore-activesupport-concern-convention
Draft

apiology wants to merge 2 commits into
masterfrom
restore-activesupport-concern-convention

Conversation

@apiology

Copy link
Copy Markdown
Owner

Claude: This PR was written by Claude Code on behalf of @apiology.

Problem

Methods Rails adds through concerns no longer complete:

class MyJob < ActiveJob::Base
  # not found: .set_callback, .skip_callback, .define_callbacks
  set_callback :perform, :before, :check
end

class Thing < ActiveRecord::Base
  has_one_attached :image
end

# completes nothing (expected: attach)
Thing.new.image.att

solargraph-rails specs went from 1 failure to 6 (devise_spec:4, rails_spec:122/132/152/158, storage_spec:4); continue-on-error in plugins.yml hides it.

Solution

Restore Convention::ActiveSupportConcern, which castwide/solargraph#1469, Remove Convention::ActiveSupportConcern removed: Plugin::ActiveSupport does not cover its object hook, which adds the class-scope methods of any included module that extends ActiveSupport::Concern (gem pins included) plus its ClassMethods module's methods, recursively.

This reverts commit 7a16244 (castwide#1469).

Plugin::ActiveSupport does not replace the convention. The convention's
object hook adds class-scope methods of any included module that
extends ActiveSupport::Concern, including gem pins (the class_methods
bodies yard-activesupport-concern maps, e.g. has_one_attached), plus
the module's ClassMethods instance methods, recursively (ActiveJob::Base
gets ActiveSupport::Callbacks::ClassMethods via ActiveJob::Callbacks).

Without it the solargraph-rails specs went from 1 failure to 6:
devise_spec:4, rails_spec:122/132/152/158 (define_callbacks,
set_callback, skip_callback not found) and storage_spec:4 (attach).

The convention.rb conflict keeps castwide#1468's autoload list and re-adds the
ActiveSupportConcern autoload and register lines.
Style/SelectByKind flags the restored select/is_a? lookup in
Convention::ActiveSupportConcern.
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.

1 participant