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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy