appoxy/simple_record — Issue #42: .pre_save ?
Author: AlexGM
Created: 2011-12-26 09:15:04+00:00
State: open

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 of 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({})

Please clarify - is this correct usage and do I need to pass any options for my case?