From b276a202ec95185051950e7d4ccd9c7087ac2bb8 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 11 Nov 2024 00:49:19 +0900 Subject: [PATCH] activerecord: CollectionProxy#build can take an array of EachPair As described above, `CollectionProxy#build` takes an array of attributes and returns list of instances of the model. --- gems/activerecord/6.0/activerecord.rbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gems/activerecord/6.0/activerecord.rbs b/gems/activerecord/6.0/activerecord.rbs index 043ab19e..f42b3fca 100644 --- a/gems/activerecord/6.0/activerecord.rbs +++ b/gems/activerecord/6.0/activerecord.rbs @@ -825,7 +825,8 @@ module ActiveRecord # # person.pets.size # => 5 # size of the collection # person.pets.count # => 0 # count from database - def build: (?_EachPair attributes) ?{ () -> untyped } -> untyped + def build: (Array[_EachPair] attributes) ?{ () -> untyped } -> Array[untyped] + | (?_EachPair attributes) ?{ () -> untyped } -> untyped alias new build