You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: activityable.rb
    path of file: ./repos/bluedoc/app/models/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

m
    
  def destroy_depend_activities
    case self.class.name
    when "Group"
      Activity.where(group_id: id).delete_all
      Notification.where(group_id: id).delete_all
    when "User"
      if type == "Group"
        Activity.where(group_id: id).delete_all
        Notification.where(group_id: id).delete_all
      else
        Activity.where(user_id: id).delete_all
        Notification.where(user_id: id).delete_all
        Activity.where(actor_id: id).delete_all
        Notification.where(actor_id: id).delete_all
      end