Add support for `cursor:` when using `in_batches` on an ActiveRecord PrivateRelation
In 8.0 rails added support for a custom cursor when calling in_batches on a relation. RBI files generated by tapioca do not currently generate this field.
Rails version: 8.1.0 tapioca version: 0.16.3
Hi @SamuelDev, what's the expected type of this cursor?
Would you like to open a PR to modify one of the sigs here:
https://github.com/Shopify/tapioca/blob/0a9f29181270905363d472a041b16443f20bd1a4/lib/tapioca/dsl/compilers/active_record_relations.rb#L917-L952
It is a column name or array of column names. Symbols, possibly strings, unsure of that specific technicality.
T.any(String, Symbol) might be a good first approximation. If other types are possible, we can widen the type in the future. It looks like it can be either a single value, or an array of values (it's passed into Array), so perhaps it should be:
T.any(String, Symbol, T::Array[T.any(String, Symbol)])
I won't be able to investigate this myself any time soon, but if you confirm that it works and open a PR, I'd be happy to review and merge
I have this open PR: https://github.com/Shopify/tapioca/pull/2315