Skip to content

Commit

Permalink
has_many scope can get passed an instance (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiculescu authored Dec 10, 2020
1 parent 598fa90 commit 9298edd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/activerecord/all/activerecord.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
1 change: 1 addition & 0 deletions lib/activerecord/all/activerecord_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9298edd

Please sign in to comment.