Where do I put rails Transactions and how do I execute them -
i have case need create 10000 entries in table , after research decided use transaction it.
my problem haven't found documentation or guide tell me put transaction or how execute it
this can achieved easily:
activerecord::base.transaction ... code ... end
the code inside block run within database transaction. if error occurs during execution, changes rolled back.