{"action":"created","comment":{"url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/comments/41422998","id":41422998,"diff_hunk":"@@ -1,9 +1,28 @@\n class PendingOrderCleanupJob < ActiveJob::Base\n+  WARNING_MESSAGE = \"Your cart has been emptied due to an inactivity.\"\n+\n   queue_as :default\n \n-  def perform(order, timestamp)\n-    if order.updated_at.to_i == timestamp && !order.completed?\n-      order.empty!\n+  def perform(order, timestamp_at_queued)\n+    if order_unchanged?(order, timestamp_at_queued) && !order.completed?","path":"app/jobs/pending_order_cleanup_job.rb","position":10,"original_position":10,"commit_id":"4ae58822e2f31d7337305a40456405ccde91177c","original_commit_id":"acf116f6b785cff7fea12a365f602f2ce264f7d0","user":{"login":"sikachu","id":4912,"avatar_url":"https://avatars.githubusercontent.com/u/4912?v=3","gravatar_id":"","url":"https://api.github.com/users/sikachu","html_url":"https://github.com/sikachu","followers_url":"https://api.github.com/users/sikachu/followers","following_url":"https://api.github.com/users/sikachu/following{/other_user}","gists_url":"https://api.github.com/users/sikachu/gists{/gist_id}","starred_url":"https://api.github.com/users/sikachu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sikachu/subscriptions","organizations_url":"https://api.github.com/users/sikachu/orgs","repos_url":"https://api.github.com/users/sikachu/repos","events_url":"https://api.github.com/users/sikachu/events{/privacy}","received_events_url":"https://api.github.com/users/sikachu/received_events","type":"User","site_admin":false},"body":"It's not really _stale_ though. The timestamp check is there so we know that the order was unchanged since it was last queued. If it was changed, that means there's another job in the queue that will take care of this order, and this job should just silently done.\r\n\r\nI'm also not sure if it's worth reopening Order class just to add this functionality either. Seems overkill.","created_at":"2015-10-07T17:55:40Z","updated_at":"2015-10-07T17:55:40Z","html_url":"https://github.com/groundctrl/spree_queue_line/pull/4#discussion_r41422998","pull_request_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/comments/41422998"},"html":{"href":"https://github.com/groundctrl/spree_queue_line/pull/4#discussion_r41422998"},"pull_request":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4","id":46931744,"html_url":"https://github.com/groundctrl/spree_queue_line/pull/4","diff_url":"https://github.com/groundctrl/spree_queue_line/pull/4.diff","patch_url":"https://github.com/groundctrl/spree_queue_line/pull/4.patch","issue_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/4","number":4,"state":"open","locked":false,"title":"Notifies user when we remove items from their cart","user":{"login":"sikachu","id":4912,"avatar_url":"https://avatars.githubusercontent.com/u/4912?v=3","gravatar_id":"","url":"https://api.github.com/users/sikachu","html_url":"https://github.com/sikachu","followers_url":"https://api.github.com/users/sikachu/followers","following_url":"https://api.github.com/users/sikachu/following{/other_user}","gists_url":"https://api.github.com/users/sikachu/gists{/gist_id}","starred_url":"https://api.github.com/users/sikachu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sikachu/subscriptions","organizations_url":"https://api.github.com/users/sikachu/orgs","repos_url":"https://api.github.com/users/sikachu/repos","events_url":"https://api.github.com/users/sikachu/events{/privacy}","received_events_url":"https://api.github.com/users/sikachu/received_events","type":"User","site_admin":false},"body":"This uses Spree Notifications to queue the flash message for the user.","created_at":"2015-10-06T17:22:12Z","updated_at":"2015-10-07T17:55:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4a1bf4a072ff7b2ed393be03a08904808b03c33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4/commits","review_comments_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4/comments","review_comment_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/comments{/number}","comments_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/4/comments","statuses_url":"https://api.github.com/repos/groundctrl/spree_queue_line/statuses/4ae58822e2f31d7337305a40456405ccde91177c","head":{"label":"groundctrl:notifications","ref":"notifications","sha":"4ae58822e2f31d7337305a40456405ccde91177c","user":{"login":"groundctrl","id":656899,"avatar_url":"https://avatars.githubusercontent.com/u/656899?v=3","gravatar_id":"","url":"https://api.github.com/users/groundctrl","html_url":"https://github.com/groundctrl","followers_url":"https://api.github.com/users/groundctrl/followers","following_url":"https://api.github.com/users/groundctrl/following{/other_user}","gists_url":"https://api.github.com/users/groundctrl/gists{/gist_id}","starred_url":"https://api.github.com/users/groundctrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groundctrl/subscriptions","organizations_url":"https://api.github.com/users/groundctrl/orgs","repos_url":"https://api.github.com/users/groundctrl/repos","events_url":"https://api.github.com/users/groundctrl/events{/privacy}","received_events_url":"https://api.github.com/users/groundctrl/received_events","type":"Organization","site_admin":false},"repo":{"id":42146702,"name":"spree_queue_line","full_name":"groundctrl/spree_queue_line","owner":{"login":"groundctrl","id":656899,"avatar_url":"https://avatars.githubusercontent.com/u/656899?v=3","gravatar_id":"","url":"https://api.github.com/users/groundctrl","html_url":"https://github.com/groundctrl","followers_url":"https://api.github.com/users/groundctrl/followers","following_url":"https://api.github.com/users/groundctrl/following{/other_user}","gists_url":"https://api.github.com/users/groundctrl/gists{/gist_id}","starred_url":"https://api.github.com/users/groundctrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groundctrl/subscriptions","organizations_url":"https://api.github.com/users/groundctrl/orgs","repos_url":"https://api.github.com/users/groundctrl/repos","events_url":"https://api.github.com/users/groundctrl/events{/privacy}","received_events_url":"https://api.github.com/users/groundctrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groundctrl/spree_queue_line","description":"","fork":false,"url":"https://api.github.com/repos/groundctrl/spree_queue_line","forks_url":"https://api.github.com/repos/groundctrl/spree_queue_line/forks","keys_url":"https://api.github.com/repos/groundctrl/spree_queue_line/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groundctrl/spree_queue_line/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groundctrl/spree_queue_line/teams","hooks_url":"https://api.github.com/repos/groundctrl/spree_queue_line/hooks","issue_events_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/events{/number}","events_url":"https://api.github.com/repos/groundctrl/spree_queue_line/events","assignees_url":"https://api.github.com/repos/groundctrl/spree_queue_line/assignees{/user}","branches_url":"https://api.github.com/repos/groundctrl/spree_queue_line/branches{/branch}","tags_url":"https://api.github.com/repos/groundctrl/spree_queue_line/tags","blobs_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/refs{/sha}","trees_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groundctrl/spree_queue_line/statuses/{sha}","languages_url":"https://api.github.com/repos/groundctrl/spree_queue_line/languages","stargazers_url":"https://api.github.com/repos/groundctrl/spree_queue_line/stargazers","contributors_url":"https://api.github.com/repos/groundctrl/spree_queue_line/contributors","subscribers_url":"https://api.github.com/repos/groundctrl/spree_queue_line/subscribers","subscription_url":"https://api.github.com/repos/groundctrl/spree_queue_line/subscription","commits_url":"https://api.github.com/repos/groundctrl/spree_queue_line/commits{/sha}","git_commits_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/commits{/sha}","comments_url":"https://api.github.com/repos/groundctrl/spree_queue_line/comments{/number}","issue_comment_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/comments{/number}","contents_url":"https://api.github.com/repos/groundctrl/spree_queue_line/contents/{+path}","compare_url":"https://api.github.com/repos/groundctrl/spree_queue_line/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groundctrl/spree_queue_line/merges","archive_url":"https://api.github.com/repos/groundctrl/spree_queue_line/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groundctrl/spree_queue_line/downloads","issues_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues{/number}","pulls_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls{/number}","milestones_url":"https://api.github.com/repos/groundctrl/spree_queue_line/milestones{/number}","notifications_url":"https://api.github.com/repos/groundctrl/spree_queue_line/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groundctrl/spree_queue_line/labels{/name}","releases_url":"https://api.github.com/repos/groundctrl/spree_queue_line/releases{/id}","created_at":"2015-09-09T00:35:59Z","updated_at":"2015-09-09T13:23:37Z","pushed_at":"2015-10-07T17:46:19Z","git_url":"git://github.com/groundctrl/spree_queue_line.git","ssh_url":"git@github.com:groundctrl/spree_queue_line.git","clone_url":"https://github.com/groundctrl/spree_queue_line.git","svn_url":"https://github.com/groundctrl/spree_queue_line","homepage":null,"size":228,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"groundctrl:master","ref":"master","sha":"98613bfac2471c94441a5eac6c6000bd4b306862","user":{"login":"groundctrl","id":656899,"avatar_url":"https://avatars.githubusercontent.com/u/656899?v=3","gravatar_id":"","url":"https://api.github.com/users/groundctrl","html_url":"https://github.com/groundctrl","followers_url":"https://api.github.com/users/groundctrl/followers","following_url":"https://api.github.com/users/groundctrl/following{/other_user}","gists_url":"https://api.github.com/users/groundctrl/gists{/gist_id}","starred_url":"https://api.github.com/users/groundctrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groundctrl/subscriptions","organizations_url":"https://api.github.com/users/groundctrl/orgs","repos_url":"https://api.github.com/users/groundctrl/repos","events_url":"https://api.github.com/users/groundctrl/events{/privacy}","received_events_url":"https://api.github.com/users/groundctrl/received_events","type":"Organization","site_admin":false},"repo":{"id":42146702,"name":"spree_queue_line","full_name":"groundctrl/spree_queue_line","owner":{"login":"groundctrl","id":656899,"avatar_url":"https://avatars.githubusercontent.com/u/656899?v=3","gravatar_id":"","url":"https://api.github.com/users/groundctrl","html_url":"https://github.com/groundctrl","followers_url":"https://api.github.com/users/groundctrl/followers","following_url":"https://api.github.com/users/groundctrl/following{/other_user}","gists_url":"https://api.github.com/users/groundctrl/gists{/gist_id}","starred_url":"https://api.github.com/users/groundctrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groundctrl/subscriptions","organizations_url":"https://api.github.com/users/groundctrl/orgs","repos_url":"https://api.github.com/users/groundctrl/repos","events_url":"https://api.github.com/users/groundctrl/events{/privacy}","received_events_url":"https://api.github.com/users/groundctrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groundctrl/spree_queue_line","description":"","fork":false,"url":"https://api.github.com/repos/groundctrl/spree_queue_line","forks_url":"https://api.github.com/repos/groundctrl/spree_queue_line/forks","keys_url":"https://api.github.com/repos/groundctrl/spree_queue_line/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groundctrl/spree_queue_line/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groundctrl/spree_queue_line/teams","hooks_url":"https://api.github.com/repos/groundctrl/spree_queue_line/hooks","issue_events_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/events{/number}","events_url":"https://api.github.com/repos/groundctrl/spree_queue_line/events","assignees_url":"https://api.github.com/repos/groundctrl/spree_queue_line/assignees{/user}","branches_url":"https://api.github.com/repos/groundctrl/spree_queue_line/branches{/branch}","tags_url":"https://api.github.com/repos/groundctrl/spree_queue_line/tags","blobs_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/refs{/sha}","trees_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groundctrl/spree_queue_line/statuses/{sha}","languages_url":"https://api.github.com/repos/groundctrl/spree_queue_line/languages","stargazers_url":"https://api.github.com/repos/groundctrl/spree_queue_line/stargazers","contributors_url":"https://api.github.com/repos/groundctrl/spree_queue_line/contributors","subscribers_url":"https://api.github.com/repos/groundctrl/spree_queue_line/subscribers","subscription_url":"https://api.github.com/repos/groundctrl/spree_queue_line/subscription","commits_url":"https://api.github.com/repos/groundctrl/spree_queue_line/commits{/sha}","git_commits_url":"https://api.github.com/repos/groundctrl/spree_queue_line/git/commits{/sha}","comments_url":"https://api.github.com/repos/groundctrl/spree_queue_line/comments{/number}","issue_comment_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/comments{/number}","contents_url":"https://api.github.com/repos/groundctrl/spree_queue_line/contents/{+path}","compare_url":"https://api.github.com/repos/groundctrl/spree_queue_line/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groundctrl/spree_queue_line/merges","archive_url":"https://api.github.com/repos/groundctrl/spree_queue_line/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groundctrl/spree_queue_line/downloads","issues_url":"https://api.github.com/repos/groundctrl/spree_queue_line/issues{/number}","pulls_url":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls{/number}","milestones_url":"https://api.github.com/repos/groundctrl/spree_queue_line/milestones{/number}","notifications_url":"https://api.github.com/repos/groundctrl/spree_queue_line/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groundctrl/spree_queue_line/labels{/name}","releases_url":"https://api.github.com/repos/groundctrl/spree_queue_line/releases{/id}","created_at":"2015-09-09T00:35:59Z","updated_at":"2015-09-09T13:23:37Z","pushed_at":"2015-10-07T17:46:19Z","git_url":"git://github.com/groundctrl/spree_queue_line.git","ssh_url":"git@github.com:groundctrl/spree_queue_line.git","clone_url":"https://github.com/groundctrl/spree_queue_line.git","svn_url":"https://github.com/groundctrl/spree_queue_line","homepage":null,"size":228,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4"},"html":{"href":"https://github.com/groundctrl/spree_queue_line/pull/4"},"issue":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/4"},"comments":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/groundctrl/spree_queue_line/statuses/4ae58822e2f31d7337305a40456405ccde91177c"}}}}