{"action":"created","comment":{"url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/comments/60409734","id":60409734,"diff_hunk":"@@ -10,10 +10,12 @@ Meteor.methods\n \n   createForm: (surveyId, props)->\n     #TODO Authenticate\n+    currentFormCount = getSurveys().findOne(surveyId).forms.length or 0\n     formId = getForms().insert\n       name: props.name\n       createdBy: @userId\n       questions: []\n+      order: ++currentFormCount","path":"app/server/methods.coffee","position":9,"original_position":9,"commit_id":"927b50d92573bb5c17873d296d7b425d478bbf82","original_commit_id":"927b50d92573bb5c17873d296d7b425d478bbf82","user":{"login":"jgoley","id":4105343,"avatar_url":"https://avatars.githubusercontent.com/u/4105343?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoley","html_url":"https://github.com/jgoley","followers_url":"https://api.github.com/users/jgoley/followers","following_url":"https://api.github.com/users/jgoley/following{/other_user}","gists_url":"https://api.github.com/users/jgoley/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoley/subscriptions","organizations_url":"https://api.github.com/users/jgoley/orgs","repos_url":"https://api.github.com/users/jgoley/repos","events_url":"https://api.github.com/users/jgoley/events{/privacy}","received_events_url":"https://api.github.com/users/jgoley/received_events","type":"User","site_admin":false},"body":"Looks like I may have been premature with the statement about updating `order` on delete. Looks like the sortable package handles re-ordering well when there is a gap in values.","created_at":"2016-04-20T13:48:11Z","updated_at":"2016-04-20T13:48:11Z","html_url":"https://github.com/ecohealthalliance/mobile-survey/pull/14#discussion_r60409734","pull_request_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/comments/60409734"},"html":{"href":"https://github.com/ecohealthalliance/mobile-survey/pull/14#discussion_r60409734"},"pull_request":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14","id":67099534,"html_url":"https://github.com/ecohealthalliance/mobile-survey/pull/14","diff_url":"https://github.com/ecohealthalliance/mobile-survey/pull/14.diff","patch_url":"https://github.com/ecohealthalliance/mobile-survey/pull/14.patch","issue_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/14","number":14,"state":"open","locked":false,"title":"Order forms","user":{"login":"jgoley","id":4105343,"avatar_url":"https://avatars.githubusercontent.com/u/4105343?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoley","html_url":"https://github.com/jgoley","followers_url":"https://api.github.com/users/jgoley/followers","following_url":"https://api.github.com/users/jgoley/following{/other_user}","gists_url":"https://api.github.com/users/jgoley/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoley/subscriptions","organizations_url":"https://api.github.com/users/jgoley/orgs","repos_url":"https://api.github.com/users/jgoley/repos","events_url":"https://api.github.com/users/jgoley/events{/privacy}","received_events_url":"https://api.github.com/users/jgoley/received_events","type":"User","site_admin":false},"body":"Allows users to sort forms by dragging and dropping.\r\nAlso sets the order properties of forms and questions on creation.\r\n\r\nI realized we will need to update the order properties of questions and forms on delete. I've added a bug to PT for questions: https://www.pivotaltracker.com/story/show/117961163","created_at":"2016-04-19T22:17:25Z","updated_at":"2016-04-20T13:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d1a2651779bded44e792e861b5a8786b84cf617","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14/commits","review_comments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14/comments","review_comment_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/14/comments","statuses_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/statuses/927b50d92573bb5c17873d296d7b425d478bbf82","head":{"label":"ecohealthalliance:order-forms","ref":"order-forms","sha":"927b50d92573bb5c17873d296d7b425d478bbf82","user":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"repo":{"id":55699433,"name":"mobile-survey","full_name":"ecohealthalliance/mobile-survey","owner":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecohealthalliance/mobile-survey","description":"Survey App for Mobile Offline Data Collection","fork":false,"url":"https://api.github.com/repos/ecohealthalliance/mobile-survey","forks_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/forks","keys_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/teams","hooks_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/hooks","issue_events_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/events{/number}","events_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/events","assignees_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/assignees{/user}","branches_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/branches{/branch}","tags_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/tags","blobs_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/statuses/{sha}","languages_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/languages","stargazers_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/stargazers","contributors_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/contributors","subscribers_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/subscribers","subscription_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/subscription","commits_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/contents/{+path}","compare_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/merges","archive_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/downloads","issues_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues{/number}","pulls_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls{/number}","milestones_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/milestones{/number}","notifications_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/labels{/name}","releases_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/releases{/id}","deployments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/deployments","created_at":"2016-04-07T14:03:53Z","updated_at":"2016-04-12T14:36:38Z","pushed_at":"2016-04-20T12:54:07Z","git_url":"git://github.com/ecohealthalliance/mobile-survey.git","ssh_url":"git@github.com:ecohealthalliance/mobile-survey.git","clone_url":"https://github.com/ecohealthalliance/mobile-survey.git","svn_url":"https://github.com/ecohealthalliance/mobile-survey","homepage":null,"size":78,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":"ecohealthalliance:master","ref":"master","sha":"122cf2eebe6fb3ec8e9fbb0d33b3b260c6044ca7","user":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"repo":{"id":55699433,"name":"mobile-survey","full_name":"ecohealthalliance/mobile-survey","owner":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecohealthalliance/mobile-survey","description":"Survey App for Mobile Offline Data Collection","fork":false,"url":"https://api.github.com/repos/ecohealthalliance/mobile-survey","forks_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/forks","keys_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/teams","hooks_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/hooks","issue_events_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/events{/number}","events_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/events","assignees_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/assignees{/user}","branches_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/branches{/branch}","tags_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/tags","blobs_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/statuses/{sha}","languages_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/languages","stargazers_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/stargazers","contributors_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/contributors","subscribers_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/subscribers","subscription_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/subscription","commits_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/contents/{+path}","compare_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/merges","archive_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/downloads","issues_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues{/number}","pulls_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls{/number}","milestones_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/milestones{/number}","notifications_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/labels{/name}","releases_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/releases{/id}","deployments_url":"https://api.github.com/repos/ecohealthalliance/mobile-survey/deployments","created_at":"2016-04-07T14:03:53Z","updated_at":"2016-04-12T14:36:38Z","pushed_at":"2016-04-20T12:54:07Z","git_url":"git://github.com/ecohealthalliance/mobile-survey.git","ssh_url":"git@github.com:ecohealthalliance/mobile-survey.git","clone_url":"https://github.com/ecohealthalliance/mobile-survey.git","svn_url":"https://github.com/ecohealthalliance/mobile-survey","homepage":null,"size":78,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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/ecohealthalliance/mobile-survey/pulls/14"},"html":{"href":"https://github.com/ecohealthalliance/mobile-survey/pull/14"},"issue":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/14"},"comments":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/ecohealthalliance/mobile-survey/statuses/927b50d92573bb5c17873d296d7b425d478bbf82"}}}}