Content-Length: 199220 | pFad | http://github.com/Shopify/tapioca/issues/2239

0D `find_in_batches` return type is wrong · Issue #2239 · Shopify/tapioca · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_in_batches return type is wrong #2239

Open
dshearer opened this issue Mar 19, 2025 · 0 comments
Open

find_in_batches return type is wrong #2239

dshearer opened this issue Mar 19, 2025 · 0 comments

Comments

@dshearer
Copy link

Hi! Here, the return type for find_in_batches is set as T::Enumerator[T::Enumerator[A]], but I believe the actual return type is T::Enumerator[T::Array[A]].

This is implied in the documentation:

Yields each batch of records that was found by the find options as an array.

And I've checked this at runtime:

MyModel.find_in_batches.map do |batch|
  T.let(batch, T::Enumerator[MyModel]) # This fails
end

This is with Tapioca 0.16.11, Sorbet 0.5.11934, and Rails 8.1.0.alpha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Shopify/tapioca/issues/2239

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy