{"action":"created","comment":{"url":"https://api.github.com/repos/toptal/granite/pulls/comments/207230103","pull_request_review_id":142798421,"id":207230103,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzIzMDEwMw==","diff_hunk":"@@ -46,8 +51,34 @@ Hello World\n => true\n ```\n \n-As you can see from log, every action execution is wrapped inside a DB transaction.\n-The main difference between these methods is: `#perform!` raises exception in case of errors and `#perform` simply returns `false`\n+You can use `Granite::Action.transaction` explicitly and wrap any logic in transaction:","path":"docs/index.md","position":20,"original_position":20,"commit_id":"82b54d3df9333fcc80e3e76972d5b60a48d6c5bd","original_commit_id":"82b54d3df9333fcc80e3e76972d5b60a48d6c5bd","user":{"login":"pyromaniac","id":88852,"node_id":"MDQ6VXNlcjg4ODUy","avatar_url":"https://avatars3.githubusercontent.com/u/88852?v=4","gravatar_id":"","url":"https://api.github.com/users/pyromaniac","html_url":"https://github.com/pyromaniac","followers_url":"https://api.github.com/users/pyromaniac/followers","following_url":"https://api.github.com/users/pyromaniac/following{/other_user}","gists_url":"https://api.github.com/users/pyromaniac/gists{/gist_id}","starred_url":"https://api.github.com/users/pyromaniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyromaniac/subscriptions","organizations_url":"https://api.github.com/users/pyromaniac/orgs","repos_url":"https://api.github.com/users/pyromaniac/repos","events_url":"https://api.github.com/users/pyromaniac/events{/privacy}","received_events_url":"https://api.github.com/users/pyromaniac/received_events","type":"User","site_admin":false},"body":"Does not `ActiveRecord::Base.transaction` work here instead?","created_at":"2018-08-02T13:43:18Z","updated_at":"2018-08-02T13:43:18Z","html_url":"https://github.com/toptal/granite/pull/11#discussion_r207230103","pull_request_url":"https://api.github.com/repos/toptal/granite/pulls/11","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/toptal/granite/pulls/comments/207230103"},"html":{"href":"https://github.com/toptal/granite/pull/11#discussion_r207230103"},"pull_request":{"href":"https://api.github.com/repos/toptal/granite/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/toptal/granite/pulls/11","id":205269428,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MjY5NDI4","html_url":"https://github.com/toptal/granite/pull/11","diff_url":"https://github.com/toptal/granite/pull/11.diff","patch_url":"https://github.com/toptal/granite/pull/11.patch","issue_url":"https://api.github.com/repos/toptal/granite/issues/11","number":11,"state":"open","locked":false,"title":"Introduce `after_commit` hook for Actions","user":{"login":"EPecherkin","id":1036610,"node_id":"MDQ6VXNlcjEwMzY2MTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1036610?v=4","gravatar_id":"","url":"https://api.github.com/users/EPecherkin","html_url":"https://github.com/EPecherkin","followers_url":"https://api.github.com/users/EPecherkin/followers","following_url":"https://api.github.com/users/EPecherkin/following{/other_user}","gists_url":"https://api.github.com/users/EPecherkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPecherkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPecherkin/subscriptions","organizations_url":"https://api.github.com/users/EPecherkin/orgs","repos_url":"https://api.github.com/users/EPecherkin/repos","events_url":"https://api.github.com/users/EPecherkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPecherkin/received_events","type":"User","site_admin":false},"body":"Now you can define `after_commit` hook inside your action\r\n\r\n```ruby\r\nafter_commit do\r\n  \"some logic here\"\r\nend\r\n```\r\nor\r\n```ruby\r\nafter_commit :method_name\r\n```\r\n\r\n### Review\r\n\r\n- [x] Document code according to [Getting Started with Yard](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md).\r\n- [x] All tests are passing.\r\n- [x] Test manually.\r\n- [ ] Get approval.\r\n\r\n### Pre-merge checklist\r\n\r\n- [x] The PR relates to a single subject with a clear title and description in grammatically correct, complete sentences.\r\n- [ ] Verify that feature branch is up-to-date with `master` (if not - rebase it).\r\n- [ ] Double check the quality of [commit messages](http://chris.beams.io/posts/git-commit/).\r\n- [ ] Squash related commits together.\r\n","created_at":"2018-07-31T23:24:59Z","updated_at":"2018-08-02T13:43:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09729d948559bd40a3f09d848d1e35174d7a661d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pirj","id":6916,"node_id":"MDQ6VXNlcjY5MTY=","avatar_url":"https://avatars0.githubusercontent.com/u/6916?v=4","gravatar_id":"","url":"https://api.github.com/users/pirj","html_url":"https://github.com/pirj","followers_url":"https://api.github.com/users/pirj/followers","following_url":"https://api.github.com/users/pirj/following{/other_user}","gists_url":"https://api.github.com/users/pirj/gists{/gist_id}","starred_url":"https://api.github.com/users/pirj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirj/subscriptions","organizations_url":"https://api.github.com/users/pirj/orgs","repos_url":"https://api.github.com/users/pirj/repos","events_url":"https://api.github.com/users/pirj/events{/privacy}","received_events_url":"https://api.github.com/users/pirj/received_events","type":"User","site_admin":false},{"login":"pluff","id":790802,"node_id":"MDQ6VXNlcjc5MDgwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/790802?v=4","gravatar_id":"","url":"https://api.github.com/users/pluff","html_url":"https://github.com/pluff","followers_url":"https://api.github.com/users/pluff/followers","following_url":"https://api.github.com/users/pluff/following{/other_user}","gists_url":"https://api.github.com/users/pluff/gists{/gist_id}","starred_url":"https://api.github.com/users/pluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pluff/subscriptions","organizations_url":"https://api.github.com/users/pluff/orgs","repos_url":"https://api.github.com/users/pluff/repos","events_url":"https://api.github.com/users/pluff/events{/privacy}","received_events_url":"https://api.github.com/users/pluff/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":846124447,"node_id":"MDU6TGFiZWw4NDYxMjQ0NDc=","url":"https://api.github.com/repos/toptal/granite/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/toptal/granite/pulls/11/commits","review_comments_url":"https://api.github.com/repos/toptal/granite/pulls/11/comments","review_comment_url":"https://api.github.com/repos/toptal/granite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toptal/granite/issues/11/comments","statuses_url":"https://api.github.com/repos/toptal/granite/statuses/82b54d3df9333fcc80e3e76972d5b60a48d6c5bd","head":{"label":"toptal:introduce-transaction-management-for-actions","ref":"introduce-transaction-management-for-actions","sha":"82b54d3df9333fcc80e3e76972d5b60a48d6c5bd","user":{"login":"toptal","id":4004158,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDQxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"repo":{"id":122619878,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MTk4Nzg=","name":"granite","full_name":"toptal/granite","owner":{"login":"toptal","id":4004158,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDQxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toptal/granite","description":"Business Actions architecture for Rails apps ","fork":false,"url":"https://api.github.com/repos/toptal/granite","forks_url":"https://api.github.com/repos/toptal/granite/forks","keys_url":"https://api.github.com/repos/toptal/granite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toptal/granite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toptal/granite/teams","hooks_url":"https://api.github.com/repos/toptal/granite/hooks","issue_events_url":"https://api.github.com/repos/toptal/granite/issues/events{/number}","events_url":"https://api.github.com/repos/toptal/granite/events","assignees_url":"https://api.github.com/repos/toptal/granite/assignees{/user}","branches_url":"https://api.github.com/repos/toptal/granite/branches{/branch}","tags_url":"https://api.github.com/repos/toptal/granite/tags","blobs_url":"https://api.github.com/repos/toptal/granite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toptal/granite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toptal/granite/git/refs{/sha}","trees_url":"https://api.github.com/repos/toptal/granite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toptal/granite/statuses/{sha}","languages_url":"https://api.github.com/repos/toptal/granite/languages","stargazers_url":"https://api.github.com/repos/toptal/granite/stargazers","contributors_url":"https://api.github.com/repos/toptal/granite/contributors","subscribers_url":"https://api.github.com/repos/toptal/granite/subscribers","subscription_url":"https://api.github.com/repos/toptal/granite/subscription","commits_url":"https://api.github.com/repos/toptal/granite/commits{/sha}","git_commits_url":"https://api.github.com/repos/toptal/granite/git/commits{/sha}","comments_url":"https://api.github.com/repos/toptal/granite/comments{/number}","issue_comment_url":"https://api.github.com/repos/toptal/granite/issues/comments{/number}","contents_url":"https://api.github.com/repos/toptal/granite/contents/{+path}","compare_url":"https://api.github.com/repos/toptal/granite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toptal/granite/merges","archive_url":"https://api.github.com/repos/toptal/granite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toptal/granite/downloads","issues_url":"https://api.github.com/repos/toptal/granite/issues{/number}","pulls_url":"https://api.github.com/repos/toptal/granite/pulls{/number}","milestones_url":"https://api.github.com/repos/toptal/granite/milestones{/number}","notifications_url":"https://api.github.com/repos/toptal/granite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toptal/granite/labels{/name}","releases_url":"https://api.github.com/repos/toptal/granite/releases{/id}","deployments_url":"https://api.github.com/repos/toptal/granite/deployments","created_at":"2018-02-23T12:40:41Z","updated_at":"2018-07-25T16:11:27Z","pushed_at":"2018-08-01T16:37:58Z","git_url":"git://github.com/toptal/granite.git","ssh_url":"git@github.com:toptal/granite.git","clone_url":"https://github.com/toptal/granite.git","svn_url":"https://github.com/toptal/granite","homepage":"https://toptal.github.io/granite/","size":413,"stargazers_count":51,"watchers_count":51,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":51,"default_branch":"master"}},"base":{"label":"toptal:master","ref":"master","sha":"8e9487090f65e3b79472919b1e387584e6a60fd2","user":{"login":"toptal","id":4004158,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDQxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"repo":{"id":122619878,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MTk4Nzg=","name":"granite","full_name":"toptal/granite","owner":{"login":"toptal","id":4004158,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMDQxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toptal/granite","description":"Business Actions architecture for Rails apps ","fork":false,"url":"https://api.github.com/repos/toptal/granite","forks_url":"https://api.github.com/repos/toptal/granite/forks","keys_url":"https://api.github.com/repos/toptal/granite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toptal/granite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toptal/granite/teams","hooks_url":"https://api.github.com/repos/toptal/granite/hooks","issue_events_url":"https://api.github.com/repos/toptal/granite/issues/events{/number}","events_url":"https://api.github.com/repos/toptal/granite/events","assignees_url":"https://api.github.com/repos/toptal/granite/assignees{/user}","branches_url":"https://api.github.com/repos/toptal/granite/branches{/branch}","tags_url":"https://api.github.com/repos/toptal/granite/tags","blobs_url":"https://api.github.com/repos/toptal/granite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toptal/granite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toptal/granite/git/refs{/sha}","trees_url":"https://api.github.com/repos/toptal/granite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toptal/granite/statuses/{sha}","languages_url":"https://api.github.com/repos/toptal/granite/languages","stargazers_url":"https://api.github.com/repos/toptal/granite/stargazers","contributors_url":"https://api.github.com/repos/toptal/granite/contributors","subscribers_url":"https://api.github.com/repos/toptal/granite/subscribers","subscription_url":"https://api.github.com/repos/toptal/granite/subscription","commits_url":"https://api.github.com/repos/toptal/granite/commits{/sha}","git_commits_url":"https://api.github.com/repos/toptal/granite/git/commits{/sha}","comments_url":"https://api.github.com/repos/toptal/granite/comments{/number}","issue_comment_url":"https://api.github.com/repos/toptal/granite/issues/comments{/number}","contents_url":"https://api.github.com/repos/toptal/granite/contents/{+path}","compare_url":"https://api.github.com/repos/toptal/granite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toptal/granite/merges","archive_url":"https://api.github.com/repos/toptal/granite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toptal/granite/downloads","issues_url":"https://api.github.com/repos/toptal/granite/issues{/number}","pulls_url":"https://api.github.com/repos/toptal/granite/pulls{/number}","milestones_url":"https://api.github.com/repos/toptal/granite/milestones{/number}","notifications_url":"https://api.github.com/repos/toptal/granite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toptal/granite/labels{/name}","releases_url":"https://api.github.com/repos/toptal/granite/releases{/id}","deployments_url":"https://api.github.com/repos/toptal/granite/deployments","created_at":"2018-02-23T12:40:41Z","updated_at":"2018-07-25T16:11:27Z","pushed_at":"2018-08-01T16:37:58Z","git_url":"git://github.com/toptal/granite.git","ssh_url":"git@github.com:toptal/granite.git","clone_url":"https://github.com/toptal/granite.git","svn_url":"https://github.com/toptal/granite","homepage":"https://toptal.github.io/granite/","size":413,"stargazers_count":51,"watchers_count":51,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/toptal/granite/pulls/11"},"html":{"href":"https://github.com/toptal/granite/pull/11"},"issue":{"href":"https://api.github.com/repos/toptal/granite/issues/11"},"comments":{"href":"https://api.github.com/repos/toptal/granite/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/toptal/granite/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/toptal/granite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toptal/granite/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/toptal/granite/statuses/82b54d3df9333fcc80e3e76972d5b60a48d6c5bd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pyromaniac"}}