You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, we might want to be able to use with_deleted: true for has_many relationships. Exemple:
classOrderItem < ApplicationRecordacts_as_paranoidendclassOrder < ApplicationRecordhas_many:order_itemsendclassSalesReceipt < ApplicationRecordbelongs_to:orderhas_many:order_items,through: :order,with_deleted: true# This currently does not workend
In this situation, if I delete an item from an order (let's say the customer did not want it anymore), I might still need the reference inside the sales receipt since the receipt was printed before the item was deleted, so it should still have access to it (because it depends on it).
Is it something that could be implemented ?
The text was updated successfully, but these errors were encountered:
Currently, you can create a model with
with_deleted: true
if you want this model to still show deleted records, but only forbelongs_to
assotiations.The second exemple currently raises this error
In some cases, we might want to be able to use
with_deleted: true
for has_many relationships. Exemple:In this situation, if I delete an item from an order (let's say the customer did not want it anymore), I might still need the reference inside the sales receipt since the receipt was printed before the item was deleted, so it should still have access to it (because it depends on it).
Is it something that could be implemented ?
The text was updated successfully, but these errors were encountered: