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.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo