{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/90863036","pull_request_review_id":11376354,"id":90863036,"diff_hunk":"@@ -25,33 +25,61 @@ class CheckoutController < Spree::StoreController\n \n     # Updates the order and advances to the next state (when possible.)\n     def update\n-      if OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply\n-        @order.temporary_address = !params[:save_user_address]\n-        success = if @order.state == 'confirm'\n-          @order.complete\n-        else\n-          @order.next\n-        end\n-        if !success\n-          flash[:error] = @order.errors.full_messages.join(\"\\n\")\n-          redirect_to(checkout_state_path(@order.state)) && return\n-        end\n+      if order_update\n+\n+        assign_temp_address\n+\n+        on_failure and return unless state_transition","path":"frontend/app/controllers/spree/checkout_controller.rb","position":19,"original_position":19,"commit_id":"5d0bf08017f37c7441471c1f1afcaf81adafb821","original_commit_id":"5d0bf08017f37c7441471c1f1afcaf81adafb821","user":{"login":"mtomov","id":1651750,"avatar_url":"https://avatars.githubusercontent.com/u/1651750?v=3","gravatar_id":"","url":"https://api.github.com/users/mtomov","html_url":"https://github.com/mtomov","followers_url":"https://api.github.com/users/mtomov/followers","following_url":"https://api.github.com/users/mtomov/following{/other_user}","gists_url":"https://api.github.com/users/mtomov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtomov/subscriptions","organizations_url":"https://api.github.com/users/mtomov/orgs","repos_url":"https://api.github.com/users/mtomov/repos","events_url":"https://api.github.com/users/mtomov/events{/privacy}","received_events_url":"https://api.github.com/users/mtomov/received_events","type":"User","site_admin":false},"body":"You might want to consider renaming `order_update`, `state_transition` and `on_failure` to their verb first equivalents to follow the schematics on the rest of the methods and to indicate that an action is happening. Say to `update_order`, `transition_forward!` and `redirect_on_failure`","created_at":"2016-12-05T13:25:23Z","updated_at":"2016-12-05T13:25:23Z","html_url":"https://github.com/solidusio/solidus/pull/1635#discussion_r90863036","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1635","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/90863036"},"html":{"href":"https://github.com/solidusio/solidus/pull/1635#discussion_r90863036"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1635"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1635","id":96344801,"html_url":"https://github.com/solidusio/solidus/pull/1635","diff_url":"https://github.com/solidusio/solidus/pull/1635.diff","patch_url":"https://github.com/solidusio/solidus/pull/1635.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1635","number":1635,"state":"open","locked":false,"title":"Refactoring Of The Checkout Controller","user":{"login":"dvassev","id":8136371,"avatar_url":"https://avatars.githubusercontent.com/u/8136371?v=3","gravatar_id":"","url":"https://api.github.com/users/dvassev","html_url":"https://github.com/dvassev","followers_url":"https://api.github.com/users/dvassev/followers","following_url":"https://api.github.com/users/dvassev/following{/other_user}","gists_url":"https://api.github.com/users/dvassev/gists{/gist_id}","starred_url":"https://api.github.com/users/dvassev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvassev/subscriptions","organizations_url":"https://api.github.com/users/dvassev/orgs","repos_url":"https://api.github.com/users/dvassev/repos","events_url":"https://api.github.com/users/dvassev/events{/privacy}","received_events_url":"https://api.github.com/users/dvassev/received_events","type":"User","site_admin":false},"body":"This refactoring decouples the update method, removing state leakage, and simplification of the method overall.","created_at":"2016-12-02T20:10:32Z","updated_at":"2016-12-05T13:25:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"609fff5793b1b69e1ff5bb5fb63b242ae2da9cfc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1635/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1635/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1635/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/5d0bf08017f37c7441471c1f1afcaf81adafb821","head":{"label":"DynamoMTL:checkout-controller-refactor","ref":"checkout-controller-refactor","sha":"5d0bf08017f37c7441471c1f1afcaf81adafb821","user":{"login":"DynamoMTL","id":543835,"avatar_url":"https://avatars.githubusercontent.com/u/543835?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoMTL","html_url":"https://github.com/DynamoMTL","followers_url":"https://api.github.com/users/DynamoMTL/followers","following_url":"https://api.github.com/users/DynamoMTL/following{/other_user}","gists_url":"https://api.github.com/users/DynamoMTL/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoMTL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoMTL/subscriptions","organizations_url":"https://api.github.com/users/DynamoMTL/orgs","repos_url":"https://api.github.com/users/DynamoMTL/repos","events_url":"https://api.github.com/users/DynamoMTL/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoMTL/received_events","type":"Organization","site_admin":false},"repo":{"id":73329405,"name":"solidus","full_name":"DynamoMTL/solidus","owner":{"login":"DynamoMTL","id":543835,"avatar_url":"https://avatars.githubusercontent.com/u/543835?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoMTL","html_url":"https://github.com/DynamoMTL","followers_url":"https://api.github.com/users/DynamoMTL/followers","following_url":"https://api.github.com/users/DynamoMTL/following{/other_user}","gists_url":"https://api.github.com/users/DynamoMTL/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoMTL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoMTL/subscriptions","organizations_url":"https://api.github.com/users/DynamoMTL/orgs","repos_url":"https://api.github.com/users/DynamoMTL/repos","events_url":"https://api.github.com/users/DynamoMTL/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoMTL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoMTL/solidus","description":"Solidus, Rails eCommerce System","fork":true,"url":"https://api.github.com/repos/DynamoMTL/solidus","forks_url":"https://api.github.com/repos/DynamoMTL/solidus/forks","keys_url":"https://api.github.com/repos/DynamoMTL/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoMTL/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoMTL/solidus/teams","hooks_url":"https://api.github.com/repos/DynamoMTL/solidus/hooks","issue_events_url":"https://api.github.com/repos/DynamoMTL/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoMTL/solidus/events","assignees_url":"https://api.github.com/repos/DynamoMTL/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoMTL/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoMTL/solidus/tags","blobs_url":"https://api.github.com/repos/DynamoMTL/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoMTL/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoMTL/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoMTL/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoMTL/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoMTL/solidus/languages","stargazers_url":"https://api.github.com/repos/DynamoMTL/solidus/stargazers","contributors_url":"https://api.github.com/repos/DynamoMTL/solidus/contributors","subscribers_url":"https://api.github.com/repos/DynamoMTL/solidus/subscribers","subscription_url":"https://api.github.com/repos/DynamoMTL/solidus/subscription","commits_url":"https://api.github.com/repos/DynamoMTL/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoMTL/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoMTL/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoMTL/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoMTL/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoMTL/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoMTL/solidus/merges","archive_url":"https://api.github.com/repos/DynamoMTL/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoMTL/solidus/downloads","issues_url":"https://api.github.com/repos/DynamoMTL/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoMTL/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoMTL/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoMTL/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoMTL/solidus/labels{/name}","releases_url":"https://api.github.com/repos/DynamoMTL/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/DynamoMTL/solidus/deployments","created_at":"2016-11-09T23:20:33Z","updated_at":"2016-11-09T23:20:37Z","pushed_at":"2016-12-02T20:07:19Z","git_url":"git://github.com/DynamoMTL/solidus.git","ssh_url":"git@github.com:DynamoMTL/solidus.git","clone_url":"https://github.com/DynamoMTL/solidus.git","svn_url":"https://github.com/DynamoMTL/solidus","homepage":"https://solidus.io/","size":64755,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"solidusio:master","ref":"master","sha":"13468d672b10930d564d225c76d8a8c30392f065","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/solidusio/solidus/deployments","created_at":"2015-02-18T20:41:58Z","updated_at":"2016-12-05T05:27:51Z","pushed_at":"2016-12-05T10:14:20Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"https://solidus.io/","size":71630,"stargazers_count":1198,"watchers_count":1198,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":375,"mirror_url":null,"open_issues_count":189,"forks":375,"open_issues":189,"watchers":1198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1635"},"html":{"href":"https://github.com/solidusio/solidus/pull/1635"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1635"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1635/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1635/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1635/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/5d0bf08017f37c7441471c1f1afcaf81adafb821"}}}}
{"actor":{"display_login":"mtomov"}}