diff --git a/lib/activerecord/all/activerecord.rbi b/lib/activerecord/all/activerecord.rbi index 61daf4f7..79896711 100644 --- a/lib/activerecord/all/activerecord.rbi +++ b/lib/activerecord/all/activerecord.rbi @@ -60,7 +60,7 @@ module ActiveRecord::Associations::ClassMethods sig do params( name: Symbol, - scope: T.nilable(T.proc.void), + scope: T.any(T.nilable(T.proc.void), T.nilable(T.proc.params(arg: T.untyped).void)), after_add: AssociationCallback, after_remove: AssociationCallback, anonymous_class: T.nilable(T.any(Symbol, String)), diff --git a/lib/activerecord/all/activerecord_test.rb b/lib/activerecord/all/activerecord_test.rb index 79b10aac..b11c08fa 100644 --- a/lib/activerecord/all/activerecord_test.rb +++ b/lib/activerecord/all/activerecord_test.rb @@ -8,6 +8,7 @@ module ActiveRecordAssociationsTest has_many :people, inverse_of: :person has_many :people, inverse_of: false has_many :people, -> { true }, class_name: "Person" + has_many :people_where_scope_is_called_with_instance, ->(instance) { true }, dependent: :destroy has_many :tracks, dependent: :destroy has_many :comments, dependent: :nullify has_many :tags, as: :taggable