So, I am using rails3_acts_as_paranoid gem and have some problems with area management with has_many: through associations.
for example
-
-
# File.rb acts_as_paranoid belongs_to :files
Now let's just say somewhere in user_controller.rb. I want to request all files belonging to the user, regardless of whether they were deleted and / or belong to the folders that were deleted. So naturally, I would suggest doing something like the following
current_user.files.with_deleted
with_deleted method does work when deleting files.deleted_at IS NULL
... BUT ... it does not remove default_scope for folders that are used behind the curtain. Thus, we still have the condition folders.deleted_at IS NULL , which does not allow me to retrieve files belonging to those folders where deleted_at is not null.
I want to continue using act_as_paranoid, as it is incredibly useful in all other places of my application, and I try not to do something like manual filtering and drop-down elements of the .where_values array. But I'm not too good at handling complex areas or methods.
Misterparker
source share