Rails - capture transaction ID while saving a collection of child records

When I save / update the project and its tasks, I would like to know what tasks will be saved in the transaction. For example, I could first create a project with several tasks, in a few hours I could add more tasks. I would like to know what tasks should be created / updated in each transaction. I could determine this by comparing the created_at fields, but this seems like a hack.

Any ideas? Can I access a transaction object in a transaction and get a unique identifier from it? That would be perfect.

+3
source share

All Articles