Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-3702

Improve background deletion logic (whitelist)

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • System
    • 8
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • 3scale 2019-11-11, 3scale 2019-11-25, 3scale 2019-12-09, 3scale 2019-12-23, 3scale 2020-01-13

      Whitelist

      Right now, we get `destroyable_associations` of an object by iterating through `reflect_on_all_associations`. Then we check if association has `dependent` option set. Either to `destroy` or `delete_all`. The main logic lives in: https://github.com/3scale/porta/blob/master/app/workers/delete_object_hierarchy_worker.rb

      The new idea is to create a new option for an object/model that would says, if the object should be deleted on the background and by which method. Something like:

      ```
      class MyNewModel < ActiveRecord::Base

      self.background_delation = :destroy
      ```

              Unassigned Unassigned
              mmacejko Michal Macejko (Inactive)
              Michal Macejko Michal Macejko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: