{"action":"created","comment":{"url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/comments/24294706","id":24294706,"diff_hunk":"@@ -21,24 +21,24 @@ def simple_current_order\n \n           if @simple_current_order\n             @simple_current_order.last_ip_address = ip_address\n-            return @simple_current_order\n+            @simple_current_order\n           else\n             @simple_current_order = Spree::Order.new\n           end\n         end\n \n-        # The current incomplete order from the guest_token for use in cart and during checkout\n-        def current_order(options = {})\n-          options[:lock] = true\n-          options[:create_order_if_necessary] ||= false\n+        DEFAULTS = {\n+          create_order_if_necessary: false\n+        }.freeze\n \n+        # The current incomplete order from the guest_token for use in cart and during checkout\n+        def current_order(options = DEFAULTS)\n           return @current_order if @current_order\n \n-          @current_order = find_order_by_token_or_user(options)\n+          @current_order = find_order_by_token_or_user(lock: true)\n \n-          if options[:create_order_if_necessary] && (@current_order.nil? || @current_order.completed?)\n+          if options.fetch(:create_order_if_necessary) && @current_order.nil?\n             @current_order = Spree::Order.new(current_order_params)\n-            @current_order.user ||= try_spree_current_user\n             # See issue #3346 for reasons why this line is here\n             @current_order.created_by ||= try_spree_current_user","path":"core/lib/spree/core/controller_helpers/order.rb","position":31,"original_position":31,"commit_id":"445a935d4478d57837dc1fdfa365412c2dc45e28","original_commit_id":"445a935d4478d57837dc1fdfa365412c2dc45e28","user":{"login":"mbj","id":117966,"avatar_url":"https://avatars.githubusercontent.com/u/117966?v=3","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"body":"@dkubb This is about intializing `created_by`, not about initializing user here. The code path that initialized user was redundant and I removed it.","created_at":"2015-02-08T01:29:58Z","updated_at":"2015-02-08T01:29:58Z","html_url":"https://github.com/MountainRoseHerbs/spree/pull/47#discussion_r24294706","pull_request_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/comments/24294706"},"html":{"href":"https://github.com/MountainRoseHerbs/spree/pull/47#discussion_r24294706"},"pull_request":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47","id":28841644,"html_url":"https://github.com/MountainRoseHerbs/spree/pull/47","diff_url":"https://github.com/MountainRoseHerbs/spree/pull/47.diff","patch_url":"https://github.com/MountainRoseHerbs/spree/pull/47.patch","issue_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/47","number":47,"state":"open","locked":false,"title":"[WIP] Fix order locking","user":{"login":"mbj","id":117966,"avatar_url":"https://avatars.githubusercontent.com/u/117966?v=3","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-06T21:02:05Z","updated_at":"2015-02-08T01:29:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea20b0968df8dbc67aabf7f62ffd9c562cdc99bd","assignee":{"login":"mbj","id":117966,"avatar_url":"https://avatars.githubusercontent.com/u/117966?v=3","gravatar_id":"","url":"https://api.github.com/users/mbj","html_url":"https://github.com/mbj","followers_url":"https://api.github.com/users/mbj/followers","following_url":"https://api.github.com/users/mbj/following{/other_user}","gists_url":"https://api.github.com/users/mbj/gists{/gist_id}","starred_url":"https://api.github.com/users/mbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbj/subscriptions","organizations_url":"https://api.github.com/users/mbj/orgs","repos_url":"https://api.github.com/users/mbj/repos","events_url":"https://api.github.com/users/mbj/events{/privacy}","received_events_url":"https://api.github.com/users/mbj/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47/commits","review_comments_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47/comments","review_comment_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/comments/{number}","comments_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/47/comments","statuses_url":"https://api.github.com/repos/MountainRoseHerbs/spree/statuses/445a935d4478d57837dc1fdfa365412c2dc45e28","head":{"label":"MountainRoseHerbs:2-3-stable-mrh-fix-lock-orders","ref":"2-3-stable-mrh-fix-lock-orders","sha":"445a935d4478d57837dc1fdfa365412c2dc45e28","user":{"login":"MountainRoseHerbs","id":2074141,"avatar_url":"https://avatars.githubusercontent.com/u/2074141?v=3","gravatar_id":"","url":"https://api.github.com/users/MountainRoseHerbs","html_url":"https://github.com/MountainRoseHerbs","followers_url":"https://api.github.com/users/MountainRoseHerbs/followers","following_url":"https://api.github.com/users/MountainRoseHerbs/following{/other_user}","gists_url":"https://api.github.com/users/MountainRoseHerbs/gists{/gist_id}","starred_url":"https://api.github.com/users/MountainRoseHerbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MountainRoseHerbs/subscriptions","organizations_url":"https://api.github.com/users/MountainRoseHerbs/orgs","repos_url":"https://api.github.com/users/MountainRoseHerbs/repos","events_url":"https://api.github.com/users/MountainRoseHerbs/events{/privacy}","received_events_url":"https://api.github.com/users/MountainRoseHerbs/received_events","type":"Organization","site_admin":false},"repo":{"id":12473049,"name":"spree","full_name":"MountainRoseHerbs/spree","owner":{"login":"MountainRoseHerbs","id":2074141,"avatar_url":"https://avatars.githubusercontent.com/u/2074141?v=3","gravatar_id":"","url":"https://api.github.com/users/MountainRoseHerbs","html_url":"https://github.com/MountainRoseHerbs","followers_url":"https://api.github.com/users/MountainRoseHerbs/followers","following_url":"https://api.github.com/users/MountainRoseHerbs/following{/other_user}","gists_url":"https://api.github.com/users/MountainRoseHerbs/gists{/gist_id}","starred_url":"https://api.github.com/users/MountainRoseHerbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MountainRoseHerbs/subscriptions","organizations_url":"https://api.github.com/users/MountainRoseHerbs/orgs","repos_url":"https://api.github.com/users/MountainRoseHerbs/repos","events_url":"https://api.github.com/users/MountainRoseHerbs/events{/privacy}","received_events_url":"https://api.github.com/users/MountainRoseHerbs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MountainRoseHerbs/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":true,"url":"https://api.github.com/repos/MountainRoseHerbs/spree","forks_url":"https://api.github.com/repos/MountainRoseHerbs/spree/forks","keys_url":"https://api.github.com/repos/MountainRoseHerbs/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MountainRoseHerbs/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MountainRoseHerbs/spree/teams","hooks_url":"https://api.github.com/repos/MountainRoseHerbs/spree/hooks","issue_events_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/events{/number}","events_url":"https://api.github.com/repos/MountainRoseHerbs/spree/events","assignees_url":"https://api.github.com/repos/MountainRoseHerbs/spree/assignees{/user}","branches_url":"https://api.github.com/repos/MountainRoseHerbs/spree/branches{/branch}","tags_url":"https://api.github.com/repos/MountainRoseHerbs/spree/tags","blobs_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MountainRoseHerbs/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/MountainRoseHerbs/spree/languages","stargazers_url":"https://api.github.com/repos/MountainRoseHerbs/spree/stargazers","contributors_url":"https://api.github.com/repos/MountainRoseHerbs/spree/contributors","subscribers_url":"https://api.github.com/repos/MountainRoseHerbs/spree/subscribers","subscription_url":"https://api.github.com/repos/MountainRoseHerbs/spree/subscription","commits_url":"https://api.github.com/repos/MountainRoseHerbs/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/MountainRoseHerbs/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/comments/{number}","contents_url":"https://api.github.com/repos/MountainRoseHerbs/spree/contents/{+path}","compare_url":"https://api.github.com/repos/MountainRoseHerbs/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MountainRoseHerbs/spree/merges","archive_url":"https://api.github.com/repos/MountainRoseHerbs/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MountainRoseHerbs/spree/downloads","issues_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues{/number}","pulls_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/MountainRoseHerbs/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/MountainRoseHerbs/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MountainRoseHerbs/spree/labels{/name}","releases_url":"https://api.github.com/repos/MountainRoseHerbs/spree/releases{/id}","created_at":"2013-08-29T22:58:09Z","updated_at":"2014-12-19T03:06:36Z","pushed_at":"2015-02-07T05:35:33Z","git_url":"git://github.com/MountainRoseHerbs/spree.git","ssh_url":"git@github.com:MountainRoseHerbs/spree.git","clone_url":"https://github.com/MountainRoseHerbs/spree.git","svn_url":"https://github.com/MountainRoseHerbs/spree","homepage":"http://spreecommerce.com","size":42673,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"2-3-stable-mrh"}},"base":{"label":"MountainRoseHerbs:2-3-stable-mrh-rebasing","ref":"2-3-stable-mrh-rebasing","sha":"0d6170c6fb157c4f9b4c6e7a7c0015340b222b0d","user":{"login":"MountainRoseHerbs","id":2074141,"avatar_url":"https://avatars.githubusercontent.com/u/2074141?v=3","gravatar_id":"","url":"https://api.github.com/users/MountainRoseHerbs","html_url":"https://github.com/MountainRoseHerbs","followers_url":"https://api.github.com/users/MountainRoseHerbs/followers","following_url":"https://api.github.com/users/MountainRoseHerbs/following{/other_user}","gists_url":"https://api.github.com/users/MountainRoseHerbs/gists{/gist_id}","starred_url":"https://api.github.com/users/MountainRoseHerbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MountainRoseHerbs/subscriptions","organizations_url":"https://api.github.com/users/MountainRoseHerbs/orgs","repos_url":"https://api.github.com/users/MountainRoseHerbs/repos","events_url":"https://api.github.com/users/MountainRoseHerbs/events{/privacy}","received_events_url":"https://api.github.com/users/MountainRoseHerbs/received_events","type":"Organization","site_admin":false},"repo":{"id":12473049,"name":"spree","full_name":"MountainRoseHerbs/spree","owner":{"login":"MountainRoseHerbs","id":2074141,"avatar_url":"https://avatars.githubusercontent.com/u/2074141?v=3","gravatar_id":"","url":"https://api.github.com/users/MountainRoseHerbs","html_url":"https://github.com/MountainRoseHerbs","followers_url":"https://api.github.com/users/MountainRoseHerbs/followers","following_url":"https://api.github.com/users/MountainRoseHerbs/following{/other_user}","gists_url":"https://api.github.com/users/MountainRoseHerbs/gists{/gist_id}","starred_url":"https://api.github.com/users/MountainRoseHerbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MountainRoseHerbs/subscriptions","organizations_url":"https://api.github.com/users/MountainRoseHerbs/orgs","repos_url":"https://api.github.com/users/MountainRoseHerbs/repos","events_url":"https://api.github.com/users/MountainRoseHerbs/events{/privacy}","received_events_url":"https://api.github.com/users/MountainRoseHerbs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MountainRoseHerbs/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":true,"url":"https://api.github.com/repos/MountainRoseHerbs/spree","forks_url":"https://api.github.com/repos/MountainRoseHerbs/spree/forks","keys_url":"https://api.github.com/repos/MountainRoseHerbs/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MountainRoseHerbs/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MountainRoseHerbs/spree/teams","hooks_url":"https://api.github.com/repos/MountainRoseHerbs/spree/hooks","issue_events_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/events{/number}","events_url":"https://api.github.com/repos/MountainRoseHerbs/spree/events","assignees_url":"https://api.github.com/repos/MountainRoseHerbs/spree/assignees{/user}","branches_url":"https://api.github.com/repos/MountainRoseHerbs/spree/branches{/branch}","tags_url":"https://api.github.com/repos/MountainRoseHerbs/spree/tags","blobs_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MountainRoseHerbs/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/MountainRoseHerbs/spree/languages","stargazers_url":"https://api.github.com/repos/MountainRoseHerbs/spree/stargazers","contributors_url":"https://api.github.com/repos/MountainRoseHerbs/spree/contributors","subscribers_url":"https://api.github.com/repos/MountainRoseHerbs/spree/subscribers","subscription_url":"https://api.github.com/repos/MountainRoseHerbs/spree/subscription","commits_url":"https://api.github.com/repos/MountainRoseHerbs/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/MountainRoseHerbs/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/MountainRoseHerbs/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/comments/{number}","contents_url":"https://api.github.com/repos/MountainRoseHerbs/spree/contents/{+path}","compare_url":"https://api.github.com/repos/MountainRoseHerbs/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MountainRoseHerbs/spree/merges","archive_url":"https://api.github.com/repos/MountainRoseHerbs/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MountainRoseHerbs/spree/downloads","issues_url":"https://api.github.com/repos/MountainRoseHerbs/spree/issues{/number}","pulls_url":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/MountainRoseHerbs/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/MountainRoseHerbs/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MountainRoseHerbs/spree/labels{/name}","releases_url":"https://api.github.com/repos/MountainRoseHerbs/spree/releases{/id}","created_at":"2013-08-29T22:58:09Z","updated_at":"2014-12-19T03:06:36Z","pushed_at":"2015-02-07T05:35:33Z","git_url":"git://github.com/MountainRoseHerbs/spree.git","ssh_url":"git@github.com:MountainRoseHerbs/spree.git","clone_url":"https://github.com/MountainRoseHerbs/spree.git","svn_url":"https://github.com/MountainRoseHerbs/spree","homepage":"http://spreecommerce.com","size":42673,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"2-3-stable-mrh"}},"_links":{"self":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47"},"html":{"href":"https://github.com/MountainRoseHerbs/spree/pull/47"},"issue":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/47"},"comments":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/MountainRoseHerbs/spree/statuses/445a935d4478d57837dc1fdfa365412c2dc45e28"}}}}