You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm back to ROR and happy to use SimpleRecord again.
I've faced with some issue. To avoid database inconsistency, I need to track method transaction and save all created objects only if the whole method did succeed.
To do it, I need to create new SimpleRecord objects, but save all of them only at the method's end.
Problem that the objects has no .id until being saved.
I've found .pre_save method and tried to use them as .pre_save({})
Looks like it does work as expected.
Please clarify - is this correct usage and do I need to pass any options for my case?
The text was updated successfully, but these errors were encountered:
Greetings!
I'm back to ROR and happy to use SimpleRecord again.
I've faced with some issue. To avoid database inconsistency, I need to track method transaction and save all created objects only if the whole method did succeed.
To do it, I need to create new SimpleRecord objects, but save all of them only at the method's end.
Problem that the objects has no .id until being saved.
I've found .pre_save method and tried to use them as .pre_save({})
Looks like it does work as expected.
Please clarify - is this correct usage and do I need to pass any options for my case?
The text was updated successfully, but these errors were encountered: