Add delete_missing option to sync commands#21
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in delete_missing keyword to the support-table sync APIs so consumers can remove database rows that are no longer present in the data files, while keeping the default behavior backward-compatible (no deletions).
Changes:
- Add
delete_missing: falsekeyword arg tosync_table_data!and propagate it throughSupportTableData.sync_all!. - Implement deletion of non-synced records when
delete_missing: true. - Add specs + README documentation + version/changelog bump for the new option.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Bumps gem version to 1.6.0. |
| spec/support_table_data_spec.rb | Adds coverage for default non-deletion and opt-in deletion for both sync_table_data! and sync_all!. |
| README.md | Documents delete_missing usage and adds cautions/tips for test setup. |
| lib/support_table_data.rb | Implements delete_missing behavior in sync_table_data! and wires through sync_all!. |
| CHANGELOG.md | Adds 1.6.0 entry describing the new option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
delete_missingoption tosync_table_data!andsync_all!. When set totrue, any records in the database that are not defined in the data files will be deleted. This option defaults tofalseto preserve backward compatibility.