Open heaven opened 2 years ago
I just encountered this as well. @heaven were you able to find a workaround?
@kroehre nope and I don't think there is an easy fix, unfortunately. In my case, I simply stopped using acts_as_paranoid on SubscriptionAddon
, which is just a :through
model between Subscription
and Price
. This allowed me to work without with_deleted
in associations. Also, building propper foreign key constraints and validations prevents deletions of a Price with active Subscriptions so this works somehow. Not as planned, though.
~@mvz could this be related to https://github.com/ActsAsParanoid/acts_as_paranoid/pull/277 ?~ Issue persists after downgrading to 0.8.0
We have Subscriptions, Products, Prices, and AddOns.
When I access
@subscription.subscription_addons
everything is great and it returns onlySubscriptionAddons
where deleted_at is null.But when I need to access
@subscription.addons
, the response also includesProducts
joined through already deletedSubscriptionAddons
. In other wordswith_deleted
that I apply tobelongs_to :product/:price
also applies tohas_many :subscription_addons
even thought it wasn't explicitly declared there. Basically, it unscopeswhere(::deleted_at)
where it shouldn't.