{"action":"created","comment":{"url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/comments/58336369","id":58336369,"diff_hunk":"@@ -25,20 +26,46 @@ def tracklist\n     tracklist\n   end\n \n-  # Returns the release date for a given album from the associated releases table\n+  def releases\n+    releases = []\n+    releases = Release.where({\"album_id\" => self.id})\n+  end\n+\n+  # Returns hash of release dates for a given album from the associated releases table\n+  # I BELIEVE there is a way to achieve this with ActiveRecord relations\n   def show_release_date\n-    Release.find_by_id(self.id).release_date\n+    dates = []\n+\n+    releases.each do |release|\n+      dates << release.release_date\n+    end\n+    dates\n   end\n \n-  # Returns the label for a given album from the associated releases table\n+  # Returns hash of labels for a given album from the associated releases table\n+  # I BELIEVE there is a way to achieve this with ActiveRecord relations\n   def show_album_label\n-    Release.find_by_id(self.id).label\n+    labels = []\n+\n+    releases.each do |release|\n+      labels << release.label\n+    end\n+    labels\n   end\n \n   # Retrieves the format_id for a given album from the associated releases table, then returns the format for that album\n-  # Refactored by removing the '.name' call on at the end of the last line to accommodate the 'formats_show_link' method\n+  # I BELIEVE there is a way to achieve this with ActiveRecord relations\n   def show_album_format\n-    format = Release.find_by_id(self.id).format_id\n-    Format.find_by_id(format)\n+    formats = []\n+    format_ids = []\n+\n+    releases.each do |release|\n+      format_ids << release.format_id\n+    end\n+    ","path":"app/models/album.rb","position":55,"original_position":55,"commit_id":"47f600130022f1f4948a500c34ad0b32e72d1507","original_commit_id":"47f600130022f1f4948a500c34ad0b32e72d1507","user":{"login":"sumeetjain","id":29388,"avatar_url":"https://avatars.githubusercontent.com/u/29388?v=3","gravatar_id":"","url":"https://api.github.com/users/sumeetjain","html_url":"https://github.com/sumeetjain","followers_url":"https://api.github.com/users/sumeetjain/followers","following_url":"https://api.github.com/users/sumeetjain/following{/other_user}","gists_url":"https://api.github.com/users/sumeetjain/gists{/gist_id}","starred_url":"https://api.github.com/users/sumeetjain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumeetjain/subscriptions","organizations_url":"https://api.github.com/users/sumeetjain/orgs","repos_url":"https://api.github.com/users/sumeetjain/repos","events_url":"https://api.github.com/users/sumeetjain/events{/privacy}","received_events_url":"https://api.github.com/users/sumeetjain/received_events","type":"User","site_admin":false},"body":"Remove trailing whitespace","created_at":"2016-04-04T07:20:20Z","updated_at":"2016-04-04T07:20:20Z","html_url":"https://github.com/omahacodeschool/vinyl-archive/pull/151#discussion_r58336369","pull_request_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151","_links":{"self":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/comments/58336369"},"html":{"href":"https://github.com/omahacodeschool/vinyl-archive/pull/151#discussion_r58336369"},"pull_request":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151"}}},"pull_request":{"url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151","id":65076516,"html_url":"https://github.com/omahacodeschool/vinyl-archive/pull/151","diff_url":"https://github.com/omahacodeschool/vinyl-archive/pull/151.diff","patch_url":"https://github.com/omahacodeschool/vinyl-archive/pull/151.patch","issue_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/151","number":151,"state":"open","locked":false,"title":"Starting testing in Rails","user":{"login":"C4L86","id":16293713,"avatar_url":"https://avatars.githubusercontent.com/u/16293713?v=3","gravatar_id":"","url":"https://api.github.com/users/C4L86","html_url":"https://github.com/C4L86","followers_url":"https://api.github.com/users/C4L86/followers","following_url":"https://api.github.com/users/C4L86/following{/other_user}","gists_url":"https://api.github.com/users/C4L86/gists{/gist_id}","starred_url":"https://api.github.com/users/C4L86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/C4L86/subscriptions","organizations_url":"https://api.github.com/users/C4L86/orgs","repos_url":"https://api.github.com/users/C4L86/repos","events_url":"https://api.github.com/users/C4L86/events{/privacy}","received_events_url":"https://api.github.com/users/C4L86/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-03T18:44:35Z","updated_at":"2016-04-04T07:20:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"883c5a4539a35b7ceece0490e6640025a6141030","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151/commits","review_comments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151/comments","review_comment_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/151/comments","statuses_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/statuses/47f600130022f1f4948a500c34ad0b32e72d1507","head":{"label":"omahacodeschool:testing-in-rails","ref":"testing-in-rails","sha":"47f600130022f1f4948a500c34ad0b32e72d1507","user":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"repo":{"id":54343171,"name":"vinyl-archive","full_name":"omahacodeschool/vinyl-archive","owner":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omahacodeschool/vinyl-archive","description":null,"fork":false,"url":"https://api.github.com/repos/omahacodeschool/vinyl-archive","forks_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/forks","keys_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/teams","hooks_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/hooks","issue_events_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/events{/number}","events_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/events","assignees_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/assignees{/user}","branches_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/branches{/branch}","tags_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/tags","blobs_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/languages","stargazers_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/stargazers","contributors_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/contributors","subscribers_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/subscribers","subscription_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/subscription","commits_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/contents/{+path}","compare_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/merges","archive_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/downloads","issues_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues{/number}","pulls_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/labels{/name}","releases_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/releases{/id}","deployments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/deployments","created_at":"2016-03-20T22:10:35Z","updated_at":"2016-03-20T22:16:23Z","pushed_at":"2016-04-04T07:16:26Z","git_url":"git://github.com/omahacodeschool/vinyl-archive.git","ssh_url":"git@github.com:omahacodeschool/vinyl-archive.git","clone_url":"https://github.com/omahacodeschool/vinyl-archive.git","svn_url":"https://github.com/omahacodeschool/vinyl-archive","homepage":null,"size":287,"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":61,"forks":0,"open_issues":61,"watchers":0,"default_branch":"master"}},"base":{"label":"omahacodeschool:master","ref":"master","sha":"7ae1b00accb5bb33d5879f7a89f4008e93611efd","user":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"repo":{"id":54343171,"name":"vinyl-archive","full_name":"omahacodeschool/vinyl-archive","owner":{"login":"omahacodeschool","id":6311183,"avatar_url":"https://avatars.githubusercontent.com/u/6311183?v=3","gravatar_id":"","url":"https://api.github.com/users/omahacodeschool","html_url":"https://github.com/omahacodeschool","followers_url":"https://api.github.com/users/omahacodeschool/followers","following_url":"https://api.github.com/users/omahacodeschool/following{/other_user}","gists_url":"https://api.github.com/users/omahacodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/omahacodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omahacodeschool/subscriptions","organizations_url":"https://api.github.com/users/omahacodeschool/orgs","repos_url":"https://api.github.com/users/omahacodeschool/repos","events_url":"https://api.github.com/users/omahacodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/omahacodeschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omahacodeschool/vinyl-archive","description":null,"fork":false,"url":"https://api.github.com/repos/omahacodeschool/vinyl-archive","forks_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/forks","keys_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/teams","hooks_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/hooks","issue_events_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/events{/number}","events_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/events","assignees_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/assignees{/user}","branches_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/branches{/branch}","tags_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/tags","blobs_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/languages","stargazers_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/stargazers","contributors_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/contributors","subscribers_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/subscribers","subscription_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/subscription","commits_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/contents/{+path}","compare_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/merges","archive_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/downloads","issues_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues{/number}","pulls_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/labels{/name}","releases_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/releases{/id}","deployments_url":"https://api.github.com/repos/omahacodeschool/vinyl-archive/deployments","created_at":"2016-03-20T22:10:35Z","updated_at":"2016-03-20T22:16:23Z","pushed_at":"2016-04-04T07:16:26Z","git_url":"git://github.com/omahacodeschool/vinyl-archive.git","ssh_url":"git@github.com:omahacodeschool/vinyl-archive.git","clone_url":"https://github.com/omahacodeschool/vinyl-archive.git","svn_url":"https://github.com/omahacodeschool/vinyl-archive","homepage":null,"size":287,"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":61,"forks":0,"open_issues":61,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151"},"html":{"href":"https://github.com/omahacodeschool/vinyl-archive/pull/151"},"issue":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/151"},"comments":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/omahacodeschool/vinyl-archive/statuses/47f600130022f1f4948a500c34ad0b32e72d1507"}}}}