From 26765f0f5358b4a284795e7696b916fa38699094 Mon Sep 17 00:00:00 2001 From: Mark Nuzzolilo Date: Mon, 14 Oct 2024 16:44:40 -0700 Subject: [PATCH] Add annotation for ActiveRecord::Relation#each The generic type_member was necessary for type tests to pass. Using anything other than { { fixed: T.untyped } } was a breaking change --- rbi/annotations/activerecord.rbi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rbi/annotations/activerecord.rbi b/rbi/annotations/activerecord.rbi index c62e484f..58feb250 100644 --- a/rbi/annotations/activerecord.rbi +++ b/rbi/annotations/activerecord.rbi @@ -196,6 +196,12 @@ class ActiveRecord::Base end class ActiveRecord::Relation + Elem = type_member(:out) { { fixed: T.untyped } } + sig { returns(T::Boolean) } def blank?; end + + sig { abstract.params(blk: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T.untyped) } + sig { abstract.returns(T::Enumerator[Elem]) } + def each(&blk); end end