-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
From the readme, this is a valid use case:
instances = [instance1, instance2]
MyModel.with_explicit_persistence_for(instances) do
instances.destroy_all
end
However, instances is an array, whereas destroy_all is a method on ActiveRecord_Relation, and passing in a relation causes a Sorbet error. I could make this work as follows:
instances = MyModel.where(some_criteria)
MyModel.with_explicit_persistence_for(instances.to_a) do
instances.destroy_all
end
but I would think with_explicit_persistence_for should allow an ActiveRecord_Relation to be passed in.
I can draft a PR when I have some free time.
Metadata
Metadata
Assignees
Labels
No labels