Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete annotations in the background #3887

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akostadinov
Copy link
Contributor

This needs to be explored.

Copy link
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what's this background deletion about, why not just using Rails dependent: :destroy instead? Or is it a different feature?

@@ -68,7 +68,7 @@ class Account < ApplicationRecord
[:files, { action: :delete, class_name: 'CMS::File' }],
[:builtin_pages, { action: :delete, class_name: 'CMS::BuiltinPage' }],
[:provided_groups, { action: :delete, class_name: 'CMS::Group' }]
].freeze
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing the freeze?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we modify in the audited method, cannot modify frozen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we may better just append to the existing empty array here too.

@@ -24,7 +24,7 @@ class Service < ApplicationRecord # rubocop:disable Metrics/ClassLength
:backend_api_configs,
:metrics,
[:proxy, { action: :destroy, has_many: false }]
].freeze
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, why removing the freeze?

@@ -8,6 +8,8 @@ def annotated
class_eval do
include Model
include ManagedBy

background_deletion << :annotations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can do this and don't remove the freeze?

Suggested change
background_deletion << :annotations
background_deletion = [*background_deletion, :annotations]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what is this background deletion about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants