{"action":"created","comment":{"url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/comments/58071117","id":58071117,"diff_hunk":"@@ -1,4 +1,27 @@\n class Stream < ActiveRecord::Base\n-  belongs_to :track\n-  belongs_to :user\n+\tbelongs_to :track\n+\tbelongs_to :user\n+\n+\tdef self.weekly_usage(streams)\n+\t\tuser_weekly_plays = 0\n+\t\ttracks_played=[]\n+\t\tindividual_track_plays=[]\n+\n+    streams.each do |stream|\n+\t\t\tuser_weekly_plays += stream.weekly_plays","path":"back-end/app/models/stream.rb","position":13,"original_position":13,"commit_id":"d57634027c3411d37046b75dd7cfdf0856592f80","original_commit_id":"d57634027c3411d37046b75dd7cfdf0856592f80","user":{"login":"drjparry","id":13313921,"avatar_url":"https://avatars.githubusercontent.com/u/13313921?v=3","gravatar_id":"","url":"https://api.github.com/users/drjparry","html_url":"https://github.com/drjparry","followers_url":"https://api.github.com/users/drjparry/followers","following_url":"https://api.github.com/users/drjparry/following{/other_user}","gists_url":"https://api.github.com/users/drjparry/gists{/gist_id}","starred_url":"https://api.github.com/users/drjparry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drjparry/subscriptions","organizations_url":"https://api.github.com/users/drjparry/orgs","repos_url":"https://api.github.com/users/drjparry/repos","events_url":"https://api.github.com/users/drjparry/events{/privacy}","received_events_url":"https://api.github.com/users/drjparry/received_events","type":"User","site_admin":false},"body":"indentation","created_at":"2016-03-31T15:11:35Z","updated_at":"2016-03-31T15:11:35Z","html_url":"https://github.com/MarcoCode/fairMuse/pull/35#discussion_r58071117","pull_request_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/comments/58071117"},"html":{"href":"https://github.com/MarcoCode/fairMuse/pull/35#discussion_r58071117"},"pull_request":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35","id":64806474,"html_url":"https://github.com/MarcoCode/fairMuse/pull/35","diff_url":"https://github.com/MarcoCode/fairMuse/pull/35.diff","patch_url":"https://github.com/MarcoCode/fairMuse/pull/35.patch","issue_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/35","number":35,"state":"open","locked":false,"title":"Refactoring controllers","user":{"login":"russellvaughan","id":16154072,"avatar_url":"https://avatars.githubusercontent.com/u/16154072?v=3","gravatar_id":"","url":"https://api.github.com/users/russellvaughan","html_url":"https://github.com/russellvaughan","followers_url":"https://api.github.com/users/russellvaughan/followers","following_url":"https://api.github.com/users/russellvaughan/following{/other_user}","gists_url":"https://api.github.com/users/russellvaughan/gists{/gist_id}","starred_url":"https://api.github.com/users/russellvaughan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russellvaughan/subscriptions","organizations_url":"https://api.github.com/users/russellvaughan/orgs","repos_url":"https://api.github.com/users/russellvaughan/repos","events_url":"https://api.github.com/users/russellvaughan/events{/privacy}","received_events_url":"https://api.github.com/users/russellvaughan/received_events","type":"User","site_admin":false},"body":"refactored controllers and artist sign up tests all passing now","created_at":"2016-03-31T15:09:48Z","updated_at":"2016-03-31T15:11:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a46096d121ca3310e7d4b238cd9381d5fab03688","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35/commits","review_comments_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35/comments","review_comment_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/35/comments","statuses_url":"https://api.github.com/repos/MarcoCode/fairMuse/statuses/d57634027c3411d37046b75dd7cfdf0856592f80","head":{"label":"MarcoCode:refactoring_controllers","ref":"refactoring_controllers","sha":"d57634027c3411d37046b75dd7cfdf0856592f80","user":{"login":"MarcoCode","id":15351248,"avatar_url":"https://avatars.githubusercontent.com/u/15351248?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoCode","html_url":"https://github.com/MarcoCode","followers_url":"https://api.github.com/users/MarcoCode/followers","following_url":"https://api.github.com/users/MarcoCode/following{/other_user}","gists_url":"https://api.github.com/users/MarcoCode/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoCode/subscriptions","organizations_url":"https://api.github.com/users/MarcoCode/orgs","repos_url":"https://api.github.com/users/MarcoCode/repos","events_url":"https://api.github.com/users/MarcoCode/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoCode/received_events","type":"User","site_admin":false},"repo":{"id":54486681,"name":"fairMuse","full_name":"MarcoCode/fairMuse","owner":{"login":"MarcoCode","id":15351248,"avatar_url":"https://avatars.githubusercontent.com/u/15351248?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoCode","html_url":"https://github.com/MarcoCode","followers_url":"https://api.github.com/users/MarcoCode/followers","following_url":"https://api.github.com/users/MarcoCode/following{/other_user}","gists_url":"https://api.github.com/users/MarcoCode/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoCode/subscriptions","organizations_url":"https://api.github.com/users/MarcoCode/orgs","repos_url":"https://api.github.com/users/MarcoCode/repos","events_url":"https://api.github.com/users/MarcoCode/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoCode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MarcoCode/fairMuse","description":"A Music streaming service that creates value for artists","fork":false,"url":"https://api.github.com/repos/MarcoCode/fairMuse","forks_url":"https://api.github.com/repos/MarcoCode/fairMuse/forks","keys_url":"https://api.github.com/repos/MarcoCode/fairMuse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarcoCode/fairMuse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarcoCode/fairMuse/teams","hooks_url":"https://api.github.com/repos/MarcoCode/fairMuse/hooks","issue_events_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/events{/number}","events_url":"https://api.github.com/repos/MarcoCode/fairMuse/events","assignees_url":"https://api.github.com/repos/MarcoCode/fairMuse/assignees{/user}","branches_url":"https://api.github.com/repos/MarcoCode/fairMuse/branches{/branch}","tags_url":"https://api.github.com/repos/MarcoCode/fairMuse/tags","blobs_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarcoCode/fairMuse/statuses/{sha}","languages_url":"https://api.github.com/repos/MarcoCode/fairMuse/languages","stargazers_url":"https://api.github.com/repos/MarcoCode/fairMuse/stargazers","contributors_url":"https://api.github.com/repos/MarcoCode/fairMuse/contributors","subscribers_url":"https://api.github.com/repos/MarcoCode/fairMuse/subscribers","subscription_url":"https://api.github.com/repos/MarcoCode/fairMuse/subscription","commits_url":"https://api.github.com/repos/MarcoCode/fairMuse/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarcoCode/fairMuse/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarcoCode/fairMuse/contents/{+path}","compare_url":"https://api.github.com/repos/MarcoCode/fairMuse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarcoCode/fairMuse/merges","archive_url":"https://api.github.com/repos/MarcoCode/fairMuse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarcoCode/fairMuse/downloads","issues_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues{/number}","pulls_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls{/number}","milestones_url":"https://api.github.com/repos/MarcoCode/fairMuse/milestones{/number}","notifications_url":"https://api.github.com/repos/MarcoCode/fairMuse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarcoCode/fairMuse/labels{/name}","releases_url":"https://api.github.com/repos/MarcoCode/fairMuse/releases{/id}","deployments_url":"https://api.github.com/repos/MarcoCode/fairMuse/deployments","created_at":"2016-03-22T15:30:16Z","updated_at":"2016-03-23T15:16:04Z","pushed_at":"2016-03-31T15:09:48Z","git_url":"git://github.com/MarcoCode/fairMuse.git","ssh_url":"git@github.com:MarcoCode/fairMuse.git","clone_url":"https://github.com/MarcoCode/fairMuse.git","svn_url":"https://github.com/MarcoCode/fairMuse","homepage":null,"size":2759,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"MarcoCode:master","ref":"master","sha":"2ee7c3804d5b6b6b0eda444fb32e2c3f45202a66","user":{"login":"MarcoCode","id":15351248,"avatar_url":"https://avatars.githubusercontent.com/u/15351248?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoCode","html_url":"https://github.com/MarcoCode","followers_url":"https://api.github.com/users/MarcoCode/followers","following_url":"https://api.github.com/users/MarcoCode/following{/other_user}","gists_url":"https://api.github.com/users/MarcoCode/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoCode/subscriptions","organizations_url":"https://api.github.com/users/MarcoCode/orgs","repos_url":"https://api.github.com/users/MarcoCode/repos","events_url":"https://api.github.com/users/MarcoCode/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoCode/received_events","type":"User","site_admin":false},"repo":{"id":54486681,"name":"fairMuse","full_name":"MarcoCode/fairMuse","owner":{"login":"MarcoCode","id":15351248,"avatar_url":"https://avatars.githubusercontent.com/u/15351248?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoCode","html_url":"https://github.com/MarcoCode","followers_url":"https://api.github.com/users/MarcoCode/followers","following_url":"https://api.github.com/users/MarcoCode/following{/other_user}","gists_url":"https://api.github.com/users/MarcoCode/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoCode/subscriptions","organizations_url":"https://api.github.com/users/MarcoCode/orgs","repos_url":"https://api.github.com/users/MarcoCode/repos","events_url":"https://api.github.com/users/MarcoCode/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoCode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MarcoCode/fairMuse","description":"A Music streaming service that creates value for artists","fork":false,"url":"https://api.github.com/repos/MarcoCode/fairMuse","forks_url":"https://api.github.com/repos/MarcoCode/fairMuse/forks","keys_url":"https://api.github.com/repos/MarcoCode/fairMuse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarcoCode/fairMuse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarcoCode/fairMuse/teams","hooks_url":"https://api.github.com/repos/MarcoCode/fairMuse/hooks","issue_events_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/events{/number}","events_url":"https://api.github.com/repos/MarcoCode/fairMuse/events","assignees_url":"https://api.github.com/repos/MarcoCode/fairMuse/assignees{/user}","branches_url":"https://api.github.com/repos/MarcoCode/fairMuse/branches{/branch}","tags_url":"https://api.github.com/repos/MarcoCode/fairMuse/tags","blobs_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarcoCode/fairMuse/statuses/{sha}","languages_url":"https://api.github.com/repos/MarcoCode/fairMuse/languages","stargazers_url":"https://api.github.com/repos/MarcoCode/fairMuse/stargazers","contributors_url":"https://api.github.com/repos/MarcoCode/fairMuse/contributors","subscribers_url":"https://api.github.com/repos/MarcoCode/fairMuse/subscribers","subscription_url":"https://api.github.com/repos/MarcoCode/fairMuse/subscription","commits_url":"https://api.github.com/repos/MarcoCode/fairMuse/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarcoCode/fairMuse/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarcoCode/fairMuse/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarcoCode/fairMuse/contents/{+path}","compare_url":"https://api.github.com/repos/MarcoCode/fairMuse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarcoCode/fairMuse/merges","archive_url":"https://api.github.com/repos/MarcoCode/fairMuse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarcoCode/fairMuse/downloads","issues_url":"https://api.github.com/repos/MarcoCode/fairMuse/issues{/number}","pulls_url":"https://api.github.com/repos/MarcoCode/fairMuse/pulls{/number}","milestones_url":"https://api.github.com/repos/MarcoCode/fairMuse/milestones{/number}","notifications_url":"https://api.github.com/repos/MarcoCode/fairMuse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarcoCode/fairMuse/labels{/name}","releases_url":"https://api.github.com/repos/MarcoCode/fairMuse/releases{/id}","deployments_url":"https://api.github.com/repos/MarcoCode/fairMuse/deployments","created_at":"2016-03-22T15:30:16Z","updated_at":"2016-03-23T15:16:04Z","pushed_at":"2016-03-31T15:09:48Z","git_url":"git://github.com/MarcoCode/fairMuse.git","ssh_url":"git@github.com:MarcoCode/fairMuse.git","clone_url":"https://github.com/MarcoCode/fairMuse.git","svn_url":"https://github.com/MarcoCode/fairMuse","homepage":null,"size":2759,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35"},"html":{"href":"https://github.com/MarcoCode/fairMuse/pull/35"},"issue":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/issues/35"},"comments":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/MarcoCode/fairMuse/statuses/d57634027c3411d37046b75dd7cfdf0856592f80"}}}}