{"comment":{"url":"https://api.github.com/repos/OggimusPrime/Bloccit/comments/10465234","html_url":"https://github.com/OggimusPrime/Bloccit/commit/94626f3720b8b4bf73563b08f116298bb932c8e3#commitcomment-10465234","id":10465234,"user":{"login":"chikamichi","id":106689,"avatar_url":"https://avatars.githubusercontent.com/u/106689?v=3","gravatar_id":"","url":"https://api.github.com/users/chikamichi","html_url":"https://github.com/chikamichi","followers_url":"https://api.github.com/users/chikamichi/followers","following_url":"https://api.github.com/users/chikamichi/following{/other_user}","gists_url":"https://api.github.com/users/chikamichi/gists{/gist_id}","starred_url":"https://api.github.com/users/chikamichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chikamichi/subscriptions","organizations_url":"https://api.github.com/users/chikamichi/orgs","repos_url":"https://api.github.com/users/chikamichi/repos","events_url":"https://api.github.com/users/chikamichi/events{/privacy}","received_events_url":"https://api.github.com/users/chikamichi/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"94626f3720b8b4bf73563b08f116298bb932c8e3","created_at":"2015-03-30T11:05:00Z","updated_at":"2015-03-30T11:05:00Z","body":"There is a shorter syntax you can use in the context of a model:\r\n\r\n``` ruby\r\ndef save_with_initial_vote\r\n  transaction do\r\n    save\r\n    create_vote\r\n  end\r\nend\r\n```\r\n\r\n(does exactly the same thing, `transaction` is just a shortcut for `ActiveRecord::Base.transaction`)"}}