{"action":"created","comment":{"url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/comments/35579032","id":35579032,"diff_hunk":"@@ -88,15 +88,9 @@ def fill_in_unanswered_questions(assessment)\n     missing_count\n   end\n \n-  def find_week_of_assessment(week_in_study)\n-    date_in_week_one = Date.current - (week_in_study - 1).weeks\n-    first_sunday = date_in_week_one - date_in_week_one.wday\n-    first_saturday = date_in_week_one.end_of_week(:sunday)\n-    return - 1 if @date < first_sunday\n-\n-    last_saturday = @date.end_of_week(:sunday)\n-\n-    # Week 1 would be (0/7) + 1 = 1, #Week 2 would be (7/7) + 1 = 2, etc\n-    (last_saturday - first_saturday) / 7 + 1\n+  # Assessments are always made available on the same day of the\n+  # week, starting on week 2 of study enrollment.\n+  def find_week_of_assessment(study_start_date)\n+    ((@date - study_start_date).days / 1.week).floor + 1","path":"app/models/phq_stepping_assessment.rb","position":76,"original_position":76,"commit_id":"e5d85d1ac2122aeb9624aa334e73cbd3ac619c20","original_commit_id":"e5d85d1ac2122aeb9624aa334e73cbd3ac619c20","user":{"login":"michaelwehrley","id":526136,"avatar_url":"https://avatars.githubusercontent.com/u/526136?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwehrley","html_url":"https://github.com/michaelwehrley","followers_url":"https://api.github.com/users/michaelwehrley/followers","following_url":"https://api.github.com/users/michaelwehrley/following{/other_user}","gists_url":"https://api.github.com/users/michaelwehrley/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwehrley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwehrley/subscriptions","organizations_url":"https://api.github.com/users/michaelwehrley/orgs","repos_url":"https://api.github.com/users/michaelwehrley/repos","events_url":"https://api.github.com/users/michaelwehrley/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwehrley/received_events","type":"User","site_admin":false},"body":"Nice improvement","created_at":"2015-07-27T19:57:09Z","updated_at":"2015-07-27T19:57:09Z","html_url":"https://github.com/cbitstech/think_feel_do_engine/pull/215#discussion_r35579032","pull_request_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215","_links":{"self":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/comments/35579032"},"html":{"href":"https://github.com/cbitstech/think_feel_do_engine/pull/215#discussion_r35579032"},"pull_request":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215","id":40940391,"html_url":"https://github.com/cbitstech/think_feel_do_engine/pull/215","diff_url":"https://github.com/cbitstech/think_feel_do_engine/pull/215.diff","patch_url":"https://github.com/cbitstech/think_feel_do_engine/pull/215.patch","issue_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/215","number":215,"state":"open","locked":false,"title":"refactor phq stepping","user":{"login":"ericcf","id":58693,"avatar_url":"https://avatars.githubusercontent.com/u/58693?v=3","gravatar_id":"","url":"https://api.github.com/users/ericcf","html_url":"https://github.com/ericcf","followers_url":"https://api.github.com/users/ericcf/followers","following_url":"https://api.github.com/users/ericcf/following{/other_user}","gists_url":"https://api.github.com/users/ericcf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericcf/subscriptions","organizations_url":"https://api.github.com/users/ericcf/orgs","repos_url":"https://api.github.com/users/ericcf/repos","events_url":"https://api.github.com/users/ericcf/events{/privacy}","received_events_url":"https://api.github.com/users/ericcf/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-27T19:34:51Z","updated_at":"2015-07-27T19:57:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfb0661dfcf1c55b84441e1ee490df59bbeacd2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215/commits","review_comments_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215/comments","review_comment_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/215/comments","statuses_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/statuses/e5d85d1ac2122aeb9624aa334e73cbd3ac619c20","head":{"label":"cbitstech:ecf_98984686_phq_stepping","ref":"ecf_98984686_phq_stepping","sha":"e5d85d1ac2122aeb9624aa334e73cbd3ac619c20","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":24353466,"name":"think_feel_do_engine","full_name":"cbitstech/think_feel_do_engine","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/think_feel_do_engine","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/think_feel_do_engine","forks_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/forks","keys_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/teams","hooks_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/events","assignees_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/tags","blobs_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/languages","stargazers_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/subscription","commits_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/merges","archive_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/downloads","issues_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/releases{/id}","created_at":"2014-09-23T02:18:05Z","updated_at":"2015-05-01T20:05:35Z","pushed_at":"2015-07-27T19:34:51Z","git_url":"git://github.com/cbitstech/think_feel_do_engine.git","ssh_url":"git@github.com:cbitstech/think_feel_do_engine.git","clone_url":"https://github.com/cbitstech/think_feel_do_engine.git","svn_url":"https://github.com/cbitstech/think_feel_do_engine","homepage":null,"size":6108,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"cbitstech:master","ref":"master","sha":"878b98c14d9daa40d5b35bcc21ed43642a906e11","user":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"repo":{"id":24353466,"name":"think_feel_do_engine","full_name":"cbitstech/think_feel_do_engine","owner":{"login":"cbitstech","id":864362,"avatar_url":"https://avatars.githubusercontent.com/u/864362?v=3","gravatar_id":"","url":"https://api.github.com/users/cbitstech","html_url":"https://github.com/cbitstech","followers_url":"https://api.github.com/users/cbitstech/followers","following_url":"https://api.github.com/users/cbitstech/following{/other_user}","gists_url":"https://api.github.com/users/cbitstech/gists{/gist_id}","starred_url":"https://api.github.com/users/cbitstech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbitstech/subscriptions","organizations_url":"https://api.github.com/users/cbitstech/orgs","repos_url":"https://api.github.com/users/cbitstech/repos","events_url":"https://api.github.com/users/cbitstech/events{/privacy}","received_events_url":"https://api.github.com/users/cbitstech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbitstech/think_feel_do_engine","description":"","fork":false,"url":"https://api.github.com/repos/cbitstech/think_feel_do_engine","forks_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/forks","keys_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/teams","hooks_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/hooks","issue_events_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/events{/number}","events_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/events","assignees_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/assignees{/user}","branches_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/branches{/branch}","tags_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/tags","blobs_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/languages","stargazers_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/stargazers","contributors_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/contributors","subscribers_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/subscribers","subscription_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/subscription","commits_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/contents/{+path}","compare_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/merges","archive_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/downloads","issues_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues{/number}","pulls_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/labels{/name}","releases_url":"https://api.github.com/repos/cbitstech/think_feel_do_engine/releases{/id}","created_at":"2014-09-23T02:18:05Z","updated_at":"2015-05-01T20:05:35Z","pushed_at":"2015-07-27T19:34:51Z","git_url":"git://github.com/cbitstech/think_feel_do_engine.git","ssh_url":"git@github.com:cbitstech/think_feel_do_engine.git","clone_url":"https://github.com/cbitstech/think_feel_do_engine.git","svn_url":"https://github.com/cbitstech/think_feel_do_engine","homepage":null,"size":6108,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215"},"html":{"href":"https://github.com/cbitstech/think_feel_do_engine/pull/215"},"issue":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/215"},"comments":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/cbitstech/think_feel_do_engine/statuses/e5d85d1ac2122aeb9624aa334e73cbd3ac619c20"}}}}