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

Bacth actions job validations for numberlists #1276

Open
dmitry-sinina opened this issue May 2, 2023 · 1 comment
Open

Bacth actions job validations for numberlists #1276

dmitry-sinina opened this issue May 2, 2023 · 1 comment
Assignees
Labels

Comments

@dmitry-sinina
Copy link
Contributor

image

image

@Ivanov-Anton
Copy link
Collaborator

Ivanov-Anton commented Oct 20, 2023

@dmitry-sinina Hi, I have a question related to the current issue.
Do you suggest to delete number list in the case when it has a related customer_auth record?

Technically we can nullify column src_numberlist_id of Customer Auth before deleting "Number list" by using dependent: :nullify option.

Ivanov-Anton pushed a commit to Ivanov-Anton/yeti-web that referenced this issue Oct 20, 2023
The dependent action for src_customers_auths and
dst_customers_auths in the numberlist model has
been changed from restrict_with_error to nullify.
This was to allow for deletion of a numberlist
item even when it has related customer_auths.
Corresponding test cases have been added to ensure
expected behavior.
@Ivanov-Anton Ivanov-Anton self-assigned this Oct 20, 2023
Ivanov-Anton pushed a commit to Ivanov-Anton/yeti-web that referenced this issue Oct 20, 2023
…y and resilience

The AsyncBatchDestroyJob has been refactored to utilise Rails's `find_in_batches`
method as opposed to a custom SQL query. This proves to make the process of record
deletion both more efficient and more resilient to database inconsistencies.

Previously, records that could not be deleted due to dependencies would raise an
exception, breaking the whole transaction. Now, these records are logged and
skipped over instead. Updates to associated tests have been made to verify and
reflect these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants