{"action":"created","comment":{"url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/comments/39254035","id":39254035,"diff_hunk":"@@ -8,11 +8,20 @@ class Prototype < ActiveRecord::Base\n \n   #acts_as_taggable_onの設定\n   acts_as_taggable\n-  attr_accessor :tag1, :tag2, :tag3\n+  attr_accessor :tag\n \n   validates :title,      presence: true\n   validates :catch_copy, presence: true\n   validates :concept,    presence: true\n   validates :title,      presence: true\n \n+  def save_thumbnail(key, value)\n+    if key == \"main\"\n+      thumbnails.main.create(image_name: value)\n+    else\n+      thumbnails.sub.create(image_name: value)\n+    end\n+  end","path":"app/models/prototype.rb","position":18,"original_position":18,"commit_id":"718889bc1f9440150b1aaf88c851bfd728074c0f","original_commit_id":"718889bc1f9440150b1aaf88c851bfd728074c0f","user":{"login":"Yama-to","id":11901022,"avatar_url":"https://avatars.githubusercontent.com/u/11901022?v=3","gravatar_id":"","url":"https://api.github.com/users/Yama-to","html_url":"https://github.com/Yama-to","followers_url":"https://api.github.com/users/Yama-to/followers","following_url":"https://api.github.com/users/Yama-to/following{/other_user}","gists_url":"https://api.github.com/users/Yama-to/gists{/gist_id}","starred_url":"https://api.github.com/users/Yama-to/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yama-to/subscriptions","organizations_url":"https://api.github.com/users/Yama-to/orgs","repos_url":"https://api.github.com/users/Yama-to/repos","events_url":"https://api.github.com/users/Yama-to/events{/privacy}","received_events_url":"https://api.github.com/users/Yama-to/received_events","type":"User","site_admin":false},"body":"上で指摘したとおり、eachメソッドの処理はControllerに書かずこちらに持ってきましょう。\r\nControllerはよりすっきりと、見やすくです。","created_at":"2015-09-11T09:15:23Z","updated_at":"2015-09-11T09:15:23Z","html_url":"https://github.com/NaokiMochizuki/protospace/pull/10#discussion_r39254035","pull_request_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/comments/39254035"},"html":{"href":"https://github.com/NaokiMochizuki/protospace/pull/10#discussion_r39254035"},"pull_request":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10","id":44298748,"html_url":"https://github.com/NaokiMochizuki/protospace/pull/10","diff_url":"https://github.com/NaokiMochizuki/protospace/pull/10.diff","patch_url":"https://github.com/NaokiMochizuki/protospace/pull/10.patch","issue_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/10","number":10,"state":"open","locked":false,"title":"Fix Problems","user":{"login":"NaokiMochizuki","id":12856100,"avatar_url":"https://avatars.githubusercontent.com/u/12856100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaokiMochizuki","html_url":"https://github.com/NaokiMochizuki","followers_url":"https://api.github.com/users/NaokiMochizuki/followers","following_url":"https://api.github.com/users/NaokiMochizuki/following{/other_user}","gists_url":"https://api.github.com/users/NaokiMochizuki/gists{/gist_id}","starred_url":"https://api.github.com/users/NaokiMochizuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaokiMochizuki/subscriptions","organizations_url":"https://api.github.com/users/NaokiMochizuki/orgs","repos_url":"https://api.github.com/users/NaokiMochizuki/repos","events_url":"https://api.github.com/users/NaokiMochizuki/events{/privacy}","received_events_url":"https://api.github.com/users/NaokiMochizuki/received_events","type":"User","site_admin":false},"body":"## What\r\n記述変更や、その他修正箇所への対応\r\n\r\n## Why\r\n次機能を作成する前に、修正すべき箇所に対応する為\r\n","created_at":"2015-09-06T08:56:57Z","updated_at":"2015-09-11T09:15:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf95611c1c29a81f7e31879f83331f59c98db1da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10/commits","review_comments_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10/comments","review_comment_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/10/comments","statuses_url":"https://api.github.com/repos/NaokiMochizuki/protospace/statuses/718889bc1f9440150b1aaf88c851bfd728074c0f","head":{"label":"NaokiMochizuki:fix_problems","ref":"fix_problems","sha":"718889bc1f9440150b1aaf88c851bfd728074c0f","user":{"login":"NaokiMochizuki","id":12856100,"avatar_url":"https://avatars.githubusercontent.com/u/12856100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaokiMochizuki","html_url":"https://github.com/NaokiMochizuki","followers_url":"https://api.github.com/users/NaokiMochizuki/followers","following_url":"https://api.github.com/users/NaokiMochizuki/following{/other_user}","gists_url":"https://api.github.com/users/NaokiMochizuki/gists{/gist_id}","starred_url":"https://api.github.com/users/NaokiMochizuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaokiMochizuki/subscriptions","organizations_url":"https://api.github.com/users/NaokiMochizuki/orgs","repos_url":"https://api.github.com/users/NaokiMochizuki/repos","events_url":"https://api.github.com/users/NaokiMochizuki/events{/privacy}","received_events_url":"https://api.github.com/users/NaokiMochizuki/received_events","type":"User","site_admin":false},"repo":{"id":40469939,"name":"protospace","full_name":"NaokiMochizuki/protospace","owner":{"login":"NaokiMochizuki","id":12856100,"avatar_url":"https://avatars.githubusercontent.com/u/12856100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaokiMochizuki","html_url":"https://github.com/NaokiMochizuki","followers_url":"https://api.github.com/users/NaokiMochizuki/followers","following_url":"https://api.github.com/users/NaokiMochizuki/following{/other_user}","gists_url":"https://api.github.com/users/NaokiMochizuki/gists{/gist_id}","starred_url":"https://api.github.com/users/NaokiMochizuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaokiMochizuki/subscriptions","organizations_url":"https://api.github.com/users/NaokiMochizuki/orgs","repos_url":"https://api.github.com/users/NaokiMochizuki/repos","events_url":"https://api.github.com/users/NaokiMochizuki/events{/privacy}","received_events_url":"https://api.github.com/users/NaokiMochizuki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NaokiMochizuki/protospace","description":"","fork":false,"url":"https://api.github.com/repos/NaokiMochizuki/protospace","forks_url":"https://api.github.com/repos/NaokiMochizuki/protospace/forks","keys_url":"https://api.github.com/repos/NaokiMochizuki/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NaokiMochizuki/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NaokiMochizuki/protospace/teams","hooks_url":"https://api.github.com/repos/NaokiMochizuki/protospace/hooks","issue_events_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/NaokiMochizuki/protospace/events","assignees_url":"https://api.github.com/repos/NaokiMochizuki/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/NaokiMochizuki/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/NaokiMochizuki/protospace/tags","blobs_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NaokiMochizuki/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/NaokiMochizuki/protospace/languages","stargazers_url":"https://api.github.com/repos/NaokiMochizuki/protospace/stargazers","contributors_url":"https://api.github.com/repos/NaokiMochizuki/protospace/contributors","subscribers_url":"https://api.github.com/repos/NaokiMochizuki/protospace/subscribers","subscription_url":"https://api.github.com/repos/NaokiMochizuki/protospace/subscription","commits_url":"https://api.github.com/repos/NaokiMochizuki/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/NaokiMochizuki/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/NaokiMochizuki/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/NaokiMochizuki/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NaokiMochizuki/protospace/merges","archive_url":"https://api.github.com/repos/NaokiMochizuki/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NaokiMochizuki/protospace/downloads","issues_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/NaokiMochizuki/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/NaokiMochizuki/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NaokiMochizuki/protospace/labels{/name}","releases_url":"https://api.github.com/repos/NaokiMochizuki/protospace/releases{/id}","created_at":"2015-08-10T07:48:40Z","updated_at":"2015-08-10T07:50:10Z","pushed_at":"2015-09-11T06:52:03Z","git_url":"git://github.com/NaokiMochizuki/protospace.git","ssh_url":"git@github.com:NaokiMochizuki/protospace.git","clone_url":"https://github.com/NaokiMochizuki/protospace.git","svn_url":"https://github.com/NaokiMochizuki/protospace","homepage":"","size":1153,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"NaokiMochizuki:master","ref":"master","sha":"358bbb691312f4ce6c0d765955dc8bf28b04b1db","user":{"login":"NaokiMochizuki","id":12856100,"avatar_url":"https://avatars.githubusercontent.com/u/12856100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaokiMochizuki","html_url":"https://github.com/NaokiMochizuki","followers_url":"https://api.github.com/users/NaokiMochizuki/followers","following_url":"https://api.github.com/users/NaokiMochizuki/following{/other_user}","gists_url":"https://api.github.com/users/NaokiMochizuki/gists{/gist_id}","starred_url":"https://api.github.com/users/NaokiMochizuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaokiMochizuki/subscriptions","organizations_url":"https://api.github.com/users/NaokiMochizuki/orgs","repos_url":"https://api.github.com/users/NaokiMochizuki/repos","events_url":"https://api.github.com/users/NaokiMochizuki/events{/privacy}","received_events_url":"https://api.github.com/users/NaokiMochizuki/received_events","type":"User","site_admin":false},"repo":{"id":40469939,"name":"protospace","full_name":"NaokiMochizuki/protospace","owner":{"login":"NaokiMochizuki","id":12856100,"avatar_url":"https://avatars.githubusercontent.com/u/12856100?v=3","gravatar_id":"","url":"https://api.github.com/users/NaokiMochizuki","html_url":"https://github.com/NaokiMochizuki","followers_url":"https://api.github.com/users/NaokiMochizuki/followers","following_url":"https://api.github.com/users/NaokiMochizuki/following{/other_user}","gists_url":"https://api.github.com/users/NaokiMochizuki/gists{/gist_id}","starred_url":"https://api.github.com/users/NaokiMochizuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaokiMochizuki/subscriptions","organizations_url":"https://api.github.com/users/NaokiMochizuki/orgs","repos_url":"https://api.github.com/users/NaokiMochizuki/repos","events_url":"https://api.github.com/users/NaokiMochizuki/events{/privacy}","received_events_url":"https://api.github.com/users/NaokiMochizuki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NaokiMochizuki/protospace","description":"","fork":false,"url":"https://api.github.com/repos/NaokiMochizuki/protospace","forks_url":"https://api.github.com/repos/NaokiMochizuki/protospace/forks","keys_url":"https://api.github.com/repos/NaokiMochizuki/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NaokiMochizuki/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NaokiMochizuki/protospace/teams","hooks_url":"https://api.github.com/repos/NaokiMochizuki/protospace/hooks","issue_events_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/NaokiMochizuki/protospace/events","assignees_url":"https://api.github.com/repos/NaokiMochizuki/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/NaokiMochizuki/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/NaokiMochizuki/protospace/tags","blobs_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NaokiMochizuki/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/NaokiMochizuki/protospace/languages","stargazers_url":"https://api.github.com/repos/NaokiMochizuki/protospace/stargazers","contributors_url":"https://api.github.com/repos/NaokiMochizuki/protospace/contributors","subscribers_url":"https://api.github.com/repos/NaokiMochizuki/protospace/subscribers","subscription_url":"https://api.github.com/repos/NaokiMochizuki/protospace/subscription","commits_url":"https://api.github.com/repos/NaokiMochizuki/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/NaokiMochizuki/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/NaokiMochizuki/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/NaokiMochizuki/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/NaokiMochizuki/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NaokiMochizuki/protospace/merges","archive_url":"https://api.github.com/repos/NaokiMochizuki/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NaokiMochizuki/protospace/downloads","issues_url":"https://api.github.com/repos/NaokiMochizuki/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/NaokiMochizuki/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/NaokiMochizuki/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NaokiMochizuki/protospace/labels{/name}","releases_url":"https://api.github.com/repos/NaokiMochizuki/protospace/releases{/id}","created_at":"2015-08-10T07:48:40Z","updated_at":"2015-08-10T07:50:10Z","pushed_at":"2015-09-11T06:52:03Z","git_url":"git://github.com/NaokiMochizuki/protospace.git","ssh_url":"git@github.com:NaokiMochizuki/protospace.git","clone_url":"https://github.com/NaokiMochizuki/protospace.git","svn_url":"https://github.com/NaokiMochizuki/protospace","homepage":"","size":1153,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10"},"html":{"href":"https://github.com/NaokiMochizuki/protospace/pull/10"},"issue":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/10"},"comments":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/NaokiMochizuki/protospace/statuses/718889bc1f9440150b1aaf88c851bfd728074c0f"}}}}