Capacity represents something that can be reserved more than 1 time and reservation marks capacity as used. When a reservation is canceled (soft deleted) the counter cache does not decrement. Removing the -> { with_deleted } is a workaround.
When a capacity is destroyed, reservations are also destroyed and we need to inform the user on these deleted items. Currently adding a second belongs_to relationship for the with_deleted scope so delegations remain functional.
Given this example
capacity.rb
reservation.rb
Capacity represents something that can be reserved more than 1 time and reservation marks capacity as used. When a reservation is canceled (soft deleted) the counter cache does not decrement. Removing the
-> { with_deleted }
is a workaround.Expectation
Actual Result
When a capacity is destroyed, reservations are also destroyed and we need to inform the user on these deleted items. Currently adding a second belongs_to relationship for the
with_deleted
scope so delegations remain functional.