{"action":"created","comment":{"url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/comments/79732628","id":79732628,"diff_hunk":"@@ -468,7 +468,7 @@ def store_at_0\n           end\n \n           def update_positions\n-            old_position = send(\"#{position_column}_was\").to_i\n+            old_position = send(\"#{position_column}_was\") || bottom_position_in_list + 1","path":"lib/acts_as_list/active_record/acts/list.rb","position":5,"original_position":5,"commit_id":"074b0375cf0e480fbcfea1c7416d37bf20c5a2e3","original_commit_id":"074b0375cf0e480fbcfea1c7416d37bf20c5a2e3","user":{"login":"brendon","id":81871,"avatar_url":"https://avatars.githubusercontent.com/u/81871?v=3","gravatar_id":"","url":"https://api.github.com/users/brendon","html_url":"https://github.com/brendon","followers_url":"https://api.github.com/users/brendon/followers","following_url":"https://api.github.com/users/brendon/following{/other_user}","gists_url":"https://api.github.com/users/brendon/gists{/gist_id}","starred_url":"https://api.github.com/users/brendon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendon/subscriptions","organizations_url":"https://api.github.com/users/brendon/orgs","repos_url":"https://api.github.com/users/brendon/repos","events_url":"https://api.github.com/users/brendon/events{/privacy}","received_events_url":"https://api.github.com/users/brendon/received_events","type":"User","site_admin":false},"body":"Thanks @StoneFrog, that's a great explanation :) Thanks for putting my mind at rest. I'll merge this.","created_at":"2016-09-20T23:10:59Z","updated_at":"2016-09-20T23:10:59Z","html_url":"https://github.com/swanandp/acts_as_list/pull/230#discussion_r79732628","pull_request_url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230","_links":{"self":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/comments/79732628"},"html":{"href":"https://github.com/swanandp/acts_as_list/pull/230#discussion_r79732628"},"pull_request":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230"}}},"pull_request":{"url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230","id":85683457,"html_url":"https://github.com/swanandp/acts_as_list/pull/230","diff_url":"https://github.com/swanandp/acts_as_list/pull/230.diff","patch_url":"https://github.com/swanandp/acts_as_list/pull/230.patch","issue_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/230","number":230,"state":"closed","locked":false,"title":"fix setting position when previous position was nil","user":{"login":"StoneFrog","id":6774970,"avatar_url":"https://avatars.githubusercontent.com/u/6774970?v=3","gravatar_id":"","url":"https://api.github.com/users/StoneFrog","html_url":"https://github.com/StoneFrog","followers_url":"https://api.github.com/users/StoneFrog/followers","following_url":"https://api.github.com/users/StoneFrog/following{/other_user}","gists_url":"https://api.github.com/users/StoneFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/StoneFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StoneFrog/subscriptions","organizations_url":"https://api.github.com/users/StoneFrog/orgs","repos_url":"https://api.github.com/users/StoneFrog/repos","events_url":"https://api.github.com/users/StoneFrog/events{/privacy}","received_events_url":"https://api.github.com/users/StoneFrog/received_events","type":"User","site_admin":false},"body":"Basically, when position is nil and we try to set new position, it didn't handle reording of other items properly. Fixes issue #109 ","created_at":"2016-09-17T18:57:31Z","updated_at":"2016-09-20T23:10:59Z","closed_at":"2016-09-20T23:10:18Z","merged_at":"2016-09-20T23:10:18Z","merge_commit_sha":"1a7b2899c9a4d1448f3e5f3ccd48dc307ad77cec","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230/commits","review_comments_url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230/comments","review_comment_url":"https://api.github.com/repos/swanandp/acts_as_list/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/230/comments","statuses_url":"https://api.github.com/repos/swanandp/acts_as_list/statuses/074b0375cf0e480fbcfea1c7416d37bf20c5a2e3","head":{"label":"StoneFrog:master","ref":"master","sha":"074b0375cf0e480fbcfea1c7416d37bf20c5a2e3","user":{"login":"StoneFrog","id":6774970,"avatar_url":"https://avatars.githubusercontent.com/u/6774970?v=3","gravatar_id":"","url":"https://api.github.com/users/StoneFrog","html_url":"https://github.com/StoneFrog","followers_url":"https://api.github.com/users/StoneFrog/followers","following_url":"https://api.github.com/users/StoneFrog/following{/other_user}","gists_url":"https://api.github.com/users/StoneFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/StoneFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StoneFrog/subscriptions","organizations_url":"https://api.github.com/users/StoneFrog/orgs","repos_url":"https://api.github.com/users/StoneFrog/repos","events_url":"https://api.github.com/users/StoneFrog/events{/privacy}","received_events_url":"https://api.github.com/users/StoneFrog/received_events","type":"User","site_admin":false},"repo":{"id":67259765,"name":"acts_as_list","full_name":"StoneFrog/acts_as_list","owner":{"login":"StoneFrog","id":6774970,"avatar_url":"https://avatars.githubusercontent.com/u/6774970?v=3","gravatar_id":"","url":"https://api.github.com/users/StoneFrog","html_url":"https://github.com/StoneFrog","followers_url":"https://api.github.com/users/StoneFrog/followers","following_url":"https://api.github.com/users/StoneFrog/following{/other_user}","gists_url":"https://api.github.com/users/StoneFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/StoneFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StoneFrog/subscriptions","organizations_url":"https://api.github.com/users/StoneFrog/orgs","repos_url":"https://api.github.com/users/StoneFrog/repos","events_url":"https://api.github.com/users/StoneFrog/events{/privacy}","received_events_url":"https://api.github.com/users/StoneFrog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StoneFrog/acts_as_list","description":"An ActiveRecord plugin for managing lists.","fork":true,"url":"https://api.github.com/repos/StoneFrog/acts_as_list","forks_url":"https://api.github.com/repos/StoneFrog/acts_as_list/forks","keys_url":"https://api.github.com/repos/StoneFrog/acts_as_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StoneFrog/acts_as_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StoneFrog/acts_as_list/teams","hooks_url":"https://api.github.com/repos/StoneFrog/acts_as_list/hooks","issue_events_url":"https://api.github.com/repos/StoneFrog/acts_as_list/issues/events{/number}","events_url":"https://api.github.com/repos/StoneFrog/acts_as_list/events","assignees_url":"https://api.github.com/repos/StoneFrog/acts_as_list/assignees{/user}","branches_url":"https://api.github.com/repos/StoneFrog/acts_as_list/branches{/branch}","tags_url":"https://api.github.com/repos/StoneFrog/acts_as_list/tags","blobs_url":"https://api.github.com/repos/StoneFrog/acts_as_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StoneFrog/acts_as_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StoneFrog/acts_as_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/StoneFrog/acts_as_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StoneFrog/acts_as_list/statuses/{sha}","languages_url":"https://api.github.com/repos/StoneFrog/acts_as_list/languages","stargazers_url":"https://api.github.com/repos/StoneFrog/acts_as_list/stargazers","contributors_url":"https://api.github.com/repos/StoneFrog/acts_as_list/contributors","subscribers_url":"https://api.github.com/repos/StoneFrog/acts_as_list/subscribers","subscription_url":"https://api.github.com/repos/StoneFrog/acts_as_list/subscription","commits_url":"https://api.github.com/repos/StoneFrog/acts_as_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/StoneFrog/acts_as_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/StoneFrog/acts_as_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/StoneFrog/acts_as_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/StoneFrog/acts_as_list/contents/{+path}","compare_url":"https://api.github.com/repos/StoneFrog/acts_as_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StoneFrog/acts_as_list/merges","archive_url":"https://api.github.com/repos/StoneFrog/acts_as_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StoneFrog/acts_as_list/downloads","issues_url":"https://api.github.com/repos/StoneFrog/acts_as_list/issues{/number}","pulls_url":"https://api.github.com/repos/StoneFrog/acts_as_list/pulls{/number}","milestones_url":"https://api.github.com/repos/StoneFrog/acts_as_list/milestones{/number}","notifications_url":"https://api.github.com/repos/StoneFrog/acts_as_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StoneFrog/acts_as_list/labels{/name}","releases_url":"https://api.github.com/repos/StoneFrog/acts_as_list/releases{/id}","deployments_url":"https://api.github.com/repos/StoneFrog/acts_as_list/deployments","created_at":"2016-09-02T22:54:33Z","updated_at":"2016-09-02T22:54:34Z","pushed_at":"2016-09-17T19:56:32Z","git_url":"git://github.com/StoneFrog/acts_as_list.git","ssh_url":"git@github.com:StoneFrog/acts_as_list.git","clone_url":"https://github.com/StoneFrog/acts_as_list.git","svn_url":"https://github.com/StoneFrog/acts_as_list","homepage":"http://swanandp.github.io/acts_as_list/","size":398,"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":"swanandp:master","ref":"master","sha":"b235b5df3205a50e2101cee05912838328934135","user":{"login":"swanandp","id":90904,"avatar_url":"https://avatars.githubusercontent.com/u/90904?v=3","gravatar_id":"","url":"https://api.github.com/users/swanandp","html_url":"https://github.com/swanandp","followers_url":"https://api.github.com/users/swanandp/followers","following_url":"https://api.github.com/users/swanandp/following{/other_user}","gists_url":"https://api.github.com/users/swanandp/gists{/gist_id}","starred_url":"https://api.github.com/users/swanandp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swanandp/subscriptions","organizations_url":"https://api.github.com/users/swanandp/orgs","repos_url":"https://api.github.com/users/swanandp/repos","events_url":"https://api.github.com/users/swanandp/events{/privacy}","received_events_url":"https://api.github.com/users/swanandp/received_events","type":"User","site_admin":false},"repo":{"id":1330786,"name":"acts_as_list","full_name":"swanandp/acts_as_list","owner":{"login":"swanandp","id":90904,"avatar_url":"https://avatars.githubusercontent.com/u/90904?v=3","gravatar_id":"","url":"https://api.github.com/users/swanandp","html_url":"https://github.com/swanandp","followers_url":"https://api.github.com/users/swanandp/followers","following_url":"https://api.github.com/users/swanandp/following{/other_user}","gists_url":"https://api.github.com/users/swanandp/gists{/gist_id}","starred_url":"https://api.github.com/users/swanandp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swanandp/subscriptions","organizations_url":"https://api.github.com/users/swanandp/orgs","repos_url":"https://api.github.com/users/swanandp/repos","events_url":"https://api.github.com/users/swanandp/events{/privacy}","received_events_url":"https://api.github.com/users/swanandp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swanandp/acts_as_list","description":"An ActiveRecord plugin for managing lists.","fork":false,"url":"https://api.github.com/repos/swanandp/acts_as_list","forks_url":"https://api.github.com/repos/swanandp/acts_as_list/forks","keys_url":"https://api.github.com/repos/swanandp/acts_as_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swanandp/acts_as_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swanandp/acts_as_list/teams","hooks_url":"https://api.github.com/repos/swanandp/acts_as_list/hooks","issue_events_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/events{/number}","events_url":"https://api.github.com/repos/swanandp/acts_as_list/events","assignees_url":"https://api.github.com/repos/swanandp/acts_as_list/assignees{/user}","branches_url":"https://api.github.com/repos/swanandp/acts_as_list/branches{/branch}","tags_url":"https://api.github.com/repos/swanandp/acts_as_list/tags","blobs_url":"https://api.github.com/repos/swanandp/acts_as_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swanandp/acts_as_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swanandp/acts_as_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/swanandp/acts_as_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swanandp/acts_as_list/statuses/{sha}","languages_url":"https://api.github.com/repos/swanandp/acts_as_list/languages","stargazers_url":"https://api.github.com/repos/swanandp/acts_as_list/stargazers","contributors_url":"https://api.github.com/repos/swanandp/acts_as_list/contributors","subscribers_url":"https://api.github.com/repos/swanandp/acts_as_list/subscribers","subscription_url":"https://api.github.com/repos/swanandp/acts_as_list/subscription","commits_url":"https://api.github.com/repos/swanandp/acts_as_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/swanandp/acts_as_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/swanandp/acts_as_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/swanandp/acts_as_list/contents/{+path}","compare_url":"https://api.github.com/repos/swanandp/acts_as_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swanandp/acts_as_list/merges","archive_url":"https://api.github.com/repos/swanandp/acts_as_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swanandp/acts_as_list/downloads","issues_url":"https://api.github.com/repos/swanandp/acts_as_list/issues{/number}","pulls_url":"https://api.github.com/repos/swanandp/acts_as_list/pulls{/number}","milestones_url":"https://api.github.com/repos/swanandp/acts_as_list/milestones{/number}","notifications_url":"https://api.github.com/repos/swanandp/acts_as_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swanandp/acts_as_list/labels{/name}","releases_url":"https://api.github.com/repos/swanandp/acts_as_list/releases{/id}","deployments_url":"https://api.github.com/repos/swanandp/acts_as_list/deployments","created_at":"2011-02-05T06:39:01Z","updated_at":"2016-09-18T03:22:42Z","pushed_at":"2016-09-20T23:10:19Z","git_url":"git://github.com/swanandp/acts_as_list.git","ssh_url":"git@github.com:swanandp/acts_as_list.git","clone_url":"https://github.com/swanandp/acts_as_list.git","svn_url":"https://github.com/swanandp/acts_as_list","homepage":"http://swanandp.github.io/acts_as_list/","size":521,"stargazers_count":1033,"watchers_count":1033,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":231,"mirror_url":null,"open_issues_count":17,"forks":231,"open_issues":17,"watchers":1033,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230"},"html":{"href":"https://github.com/swanandp/acts_as_list/pull/230"},"issue":{"href":"https://api.github.com/repos/swanandp/acts_as_list/issues/230"},"comments":{"href":"https://api.github.com/repos/swanandp/acts_as_list/issues/230/comments"},"review_comments":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230/comments"},"review_comment":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swanandp/acts_as_list/pulls/230/commits"},"statuses":{"href":"https://api.github.com/repos/swanandp/acts_as_list/statuses/074b0375cf0e480fbcfea1c7416d37bf20c5a2e3"}}}}
{"actor":{"display_login":"brendon"}}