Skip to content

Support providing a callback class to after_* methods in ActiveRecord #326

@tmcw

Description

@tmcw

ActiveRecord supports providing a class as the argument to a callback: https://guides.rubyonrails.org/active_record_callbacks.html#callback-classes

class PictureFile < ApplicationRecord
  after_destroy PictureFileCallbacks
end

But the types for ActiveRecord classes only allow a nilable Symbol as the first argument to callbacks:

arg: T.nilable(Symbol),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions