Project is being serialized when enqueueing to sidekiq
def enqueue_private_features_worker
project_ids.each do |project_id|
TodosDestroyer::PrivateFeaturesWorker.perform_async(project_id, user.id)
end
end
project_ids here is actually a relation so project_id is an ActiveRecord object.
We should only pass ids to workers so the whole object doesn't need to be serialized in Redis.
We should also consider renaming the method to projects to prevent confusion. Note that #project_ids is overriden from Todos::Destroy::BaseService so we probably still need a project_ids method.
Aside from the unnecessary serialization / deserialization, the code should be working fine because it's just passed from the worker to the service and into ProjectFeature.where(project_id: project_ids) which should properly handle either ids or objects.