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

Suggestion for optimization #35

Open
catmando opened this issue Jun 5, 2023 · 1 comment
Open

Suggestion for optimization #35

catmando opened this issue Jun 5, 2023 · 1 comment

Comments

@catmando
Copy link

catmando commented Jun 5, 2023

Has there been any thought to making only work within a transaction?

I.e. if no AR transaction is happening then don't do anything, but once you are inside a transaction then start recording.

This way if you are applying this gem to all models, you maybe don't have to worry as much about efficiency.

@catmando
Copy link
Author

catmando commented Jun 5, 2023

Further thinking about this... why not just accumulate the active_record previous_changes values until the the transaction is exited? Understand both these suggestions would probably require monkey patching, but still it seems it might be more efficient? Just wondering if this occurred to anyone already

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

1 participant