ActsAsParanoid / acts_as_paranoid

ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
MIT License
1.46k stars 191 forks source link

Fix association building for belongs_to with :with_deleted option #277

Closed mvz closed 2 years ago

mvz commented 2 years ago

The override of belongs_to creates a scope in the association where normally there would be none if the :with_deleted option is given. Having a scope in an association makes ActiveRecord refuse to automatically find an inverse relation. This change adds an override to make an exception if the scope was only added to support the :with_deleted option.

Fixes #232.