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

Saving log with only metadata changes #241

Open
whognu opened this issue Oct 4, 2023 · 1 comment
Open

Saving log with only metadata changes #241

whognu opened this issue Oct 4, 2023 · 1 comment

Comments

@whognu
Copy link

whognu commented Oct 4, 2023

Currently, Logidze seems to populate something to log_data only if there are changes to save on the model, but there are times that we'd like to save some metadata to log_data, without any changes being present in the model itself. I assume Logidze is tied into the model with a save callback or the like, so I'm not sure how practical this is, or if it risks a superfluous recursive call (or calls), but if it's workable, it would be better than having to put a dummy column on the model to change when we ant to trigger the log_data update.

@palkan
Copy link
Owner

palkan commented Oct 10, 2023

assume Logidze is tied into the model with a save callback or the like

Logidze uses database triggers; so, there is no way to write metadata without touching the database record. The easiest way to achieve this is to call #touch on the record, no need to use a virtual model.

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

No branches or pull requests

2 participants