Use after_commit callback

To trigger methods only after the entire transaction is complete.
Merge pull request #38 from yevgenko/use-after_commit

Use after_commit callback