{"action":"created","comment":{"url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/comments/50089026","id":50089026,"diff_hunk":"@@ -0,0 +1,47 @@\n+class IngredientController < ApplicationController\n+  def new\n+    if params[:name]\n+      i = Ingredient.create(:name => params[:name])\n+      if i.valid?\n+        \n+      else\n+        render :status => 500\n+      end\n+    else\n+      render :status => 500\n+    end\n+  end\n+\n+  def index\n+    @ingredients = Ingredient.all\n+  end\n+\n+  def update\n+    if params[:id] and params[:name]\n+      \n+      if Ingredient.exists?(params[:id])\n+        i = Ingredient.find(params[:id])\n+        i.name = params[:name]\n+        i.save","path":"app/controllers/ingredient_controller.rb","position":25,"original_position":25,"commit_id":"db8993974cf27fab2124bebec8cc25b15a3df642","original_commit_id":"db8993974cf27fab2124bebec8cc25b15a3df642","user":{"login":"achr3f","id":1219738,"avatar_url":"https://avatars.githubusercontent.com/u/1219738?v=3","gravatar_id":"","url":"https://api.github.com/users/achr3f","html_url":"https://github.com/achr3f","followers_url":"https://api.github.com/users/achr3f/followers","following_url":"https://api.github.com/users/achr3f/following{/other_user}","gists_url":"https://api.github.com/users/achr3f/gists{/gist_id}","starred_url":"https://api.github.com/users/achr3f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achr3f/subscriptions","organizations_url":"https://api.github.com/users/achr3f/orgs","repos_url":"https://api.github.com/users/achr3f/repos","events_url":"https://api.github.com/users/achr3f/events{/privacy}","received_events_url":"https://api.github.com/users/achr3f/received_events","type":"User","site_admin":false},"body":"```ruby\r\n +        i = Ingredient.find(params[:id])\r\n +        i.name = params[:name]\r\n +        i.save\r\n```\r\n 1 line instead of 3 \r\n```ruby\r\nIngredient.find( params[:id] ).update( name: params[:name] )\r\n```","created_at":"2016-01-19T09:26:17Z","updated_at":"2016-01-19T09:26:17Z","html_url":"https://github.com/melas123/CookingRecipe/pull/4#discussion_r50089026","pull_request_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/melas123/CookingRecipe/pulls/comments/50089026"},"html":{"href":"https://github.com/melas123/CookingRecipe/pull/4#discussion_r50089026"},"pull_request":{"href":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4","id":56361817,"html_url":"https://github.com/melas123/CookingRecipe/pull/4","diff_url":"https://github.com/melas123/CookingRecipe/pull/4.diff","patch_url":"https://github.com/melas123/CookingRecipe/pull/4.patch","issue_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/4","number":4,"state":"open","locked":false,"title":"Feature ingredients","user":{"login":"insatmc","id":5307582,"avatar_url":"https://avatars.githubusercontent.com/u/5307582?v=3","gravatar_id":"","url":"https://api.github.com/users/insatmc","html_url":"https://github.com/insatmc","followers_url":"https://api.github.com/users/insatmc/followers","following_url":"https://api.github.com/users/insatmc/following{/other_user}","gists_url":"https://api.github.com/users/insatmc/gists{/gist_id}","starred_url":"https://api.github.com/users/insatmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insatmc/subscriptions","organizations_url":"https://api.github.com/users/insatmc/orgs","repos_url":"https://api.github.com/users/insatmc/repos","events_url":"https://api.github.com/users/insatmc/events{/privacy}","received_events_url":"https://api.github.com/users/insatmc/received_events","type":"User","site_admin":false},"body":"Add backend for the Ingredient and Ingredient-Recipe Models","created_at":"2016-01-18T16:12:22Z","updated_at":"2016-01-19T09:26:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4/commits","review_comments_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4/comments","review_comment_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/4/comments","statuses_url":"https://api.github.com/repos/melas123/CookingRecipe/statuses/db8993974cf27fab2124bebec8cc25b15a3df642","head":{"label":"melas123:FEATURE-INGREDIENTS","ref":"FEATURE-INGREDIENTS","sha":"db8993974cf27fab2124bebec8cc25b15a3df642","user":{"login":"melas123","id":6131026,"avatar_url":"https://avatars.githubusercontent.com/u/6131026?v=3","gravatar_id":"","url":"https://api.github.com/users/melas123","html_url":"https://github.com/melas123","followers_url":"https://api.github.com/users/melas123/followers","following_url":"https://api.github.com/users/melas123/following{/other_user}","gists_url":"https://api.github.com/users/melas123/gists{/gist_id}","starred_url":"https://api.github.com/users/melas123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melas123/subscriptions","organizations_url":"https://api.github.com/users/melas123/orgs","repos_url":"https://api.github.com/users/melas123/repos","events_url":"https://api.github.com/users/melas123/events{/privacy}","received_events_url":"https://api.github.com/users/melas123/received_events","type":"User","site_admin":false},"repo":{"id":49868379,"name":"CookingRecipe","full_name":"melas123/CookingRecipe","owner":{"login":"melas123","id":6131026,"avatar_url":"https://avatars.githubusercontent.com/u/6131026?v=3","gravatar_id":"","url":"https://api.github.com/users/melas123","html_url":"https://github.com/melas123","followers_url":"https://api.github.com/users/melas123/followers","following_url":"https://api.github.com/users/melas123/following{/other_user}","gists_url":"https://api.github.com/users/melas123/gists{/gist_id}","starred_url":"https://api.github.com/users/melas123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melas123/subscriptions","organizations_url":"https://api.github.com/users/melas123/orgs","repos_url":"https://api.github.com/users/melas123/repos","events_url":"https://api.github.com/users/melas123/events{/privacy}","received_events_url":"https://api.github.com/users/melas123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/melas123/CookingRecipe","description":"manipulate rails angular and git","fork":false,"url":"https://api.github.com/repos/melas123/CookingRecipe","forks_url":"https://api.github.com/repos/melas123/CookingRecipe/forks","keys_url":"https://api.github.com/repos/melas123/CookingRecipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/melas123/CookingRecipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/melas123/CookingRecipe/teams","hooks_url":"https://api.github.com/repos/melas123/CookingRecipe/hooks","issue_events_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/events{/number}","events_url":"https://api.github.com/repos/melas123/CookingRecipe/events","assignees_url":"https://api.github.com/repos/melas123/CookingRecipe/assignees{/user}","branches_url":"https://api.github.com/repos/melas123/CookingRecipe/branches{/branch}","tags_url":"https://api.github.com/repos/melas123/CookingRecipe/tags","blobs_url":"https://api.github.com/repos/melas123/CookingRecipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/melas123/CookingRecipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/melas123/CookingRecipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/melas123/CookingRecipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/melas123/CookingRecipe/statuses/{sha}","languages_url":"https://api.github.com/repos/melas123/CookingRecipe/languages","stargazers_url":"https://api.github.com/repos/melas123/CookingRecipe/stargazers","contributors_url":"https://api.github.com/repos/melas123/CookingRecipe/contributors","subscribers_url":"https://api.github.com/repos/melas123/CookingRecipe/subscribers","subscription_url":"https://api.github.com/repos/melas123/CookingRecipe/subscription","commits_url":"https://api.github.com/repos/melas123/CookingRecipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/melas123/CookingRecipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/melas123/CookingRecipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/melas123/CookingRecipe/contents/{+path}","compare_url":"https://api.github.com/repos/melas123/CookingRecipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/melas123/CookingRecipe/merges","archive_url":"https://api.github.com/repos/melas123/CookingRecipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/melas123/CookingRecipe/downloads","issues_url":"https://api.github.com/repos/melas123/CookingRecipe/issues{/number}","pulls_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls{/number}","milestones_url":"https://api.github.com/repos/melas123/CookingRecipe/milestones{/number}","notifications_url":"https://api.github.com/repos/melas123/CookingRecipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/melas123/CookingRecipe/labels{/name}","releases_url":"https://api.github.com/repos/melas123/CookingRecipe/releases{/id}","created_at":"2016-01-18T10:05:55Z","updated_at":"2016-01-18T10:09:41Z","pushed_at":"2016-01-19T09:00:29Z","git_url":"git://github.com/melas123/CookingRecipe.git","ssh_url":"git@github.com:melas123/CookingRecipe.git","clone_url":"https://github.com/melas123/CookingRecipe.git","svn_url":"https://github.com/melas123/CookingRecipe","homepage":null,"size":309,"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":"melas123:master","ref":"master","sha":"0f15ceb65450b81b8c0178baf58a9fa75922b9d2","user":{"login":"melas123","id":6131026,"avatar_url":"https://avatars.githubusercontent.com/u/6131026?v=3","gravatar_id":"","url":"https://api.github.com/users/melas123","html_url":"https://github.com/melas123","followers_url":"https://api.github.com/users/melas123/followers","following_url":"https://api.github.com/users/melas123/following{/other_user}","gists_url":"https://api.github.com/users/melas123/gists{/gist_id}","starred_url":"https://api.github.com/users/melas123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melas123/subscriptions","organizations_url":"https://api.github.com/users/melas123/orgs","repos_url":"https://api.github.com/users/melas123/repos","events_url":"https://api.github.com/users/melas123/events{/privacy}","received_events_url":"https://api.github.com/users/melas123/received_events","type":"User","site_admin":false},"repo":{"id":49868379,"name":"CookingRecipe","full_name":"melas123/CookingRecipe","owner":{"login":"melas123","id":6131026,"avatar_url":"https://avatars.githubusercontent.com/u/6131026?v=3","gravatar_id":"","url":"https://api.github.com/users/melas123","html_url":"https://github.com/melas123","followers_url":"https://api.github.com/users/melas123/followers","following_url":"https://api.github.com/users/melas123/following{/other_user}","gists_url":"https://api.github.com/users/melas123/gists{/gist_id}","starred_url":"https://api.github.com/users/melas123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melas123/subscriptions","organizations_url":"https://api.github.com/users/melas123/orgs","repos_url":"https://api.github.com/users/melas123/repos","events_url":"https://api.github.com/users/melas123/events{/privacy}","received_events_url":"https://api.github.com/users/melas123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/melas123/CookingRecipe","description":"manipulate rails angular and git","fork":false,"url":"https://api.github.com/repos/melas123/CookingRecipe","forks_url":"https://api.github.com/repos/melas123/CookingRecipe/forks","keys_url":"https://api.github.com/repos/melas123/CookingRecipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/melas123/CookingRecipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/melas123/CookingRecipe/teams","hooks_url":"https://api.github.com/repos/melas123/CookingRecipe/hooks","issue_events_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/events{/number}","events_url":"https://api.github.com/repos/melas123/CookingRecipe/events","assignees_url":"https://api.github.com/repos/melas123/CookingRecipe/assignees{/user}","branches_url":"https://api.github.com/repos/melas123/CookingRecipe/branches{/branch}","tags_url":"https://api.github.com/repos/melas123/CookingRecipe/tags","blobs_url":"https://api.github.com/repos/melas123/CookingRecipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/melas123/CookingRecipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/melas123/CookingRecipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/melas123/CookingRecipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/melas123/CookingRecipe/statuses/{sha}","languages_url":"https://api.github.com/repos/melas123/CookingRecipe/languages","stargazers_url":"https://api.github.com/repos/melas123/CookingRecipe/stargazers","contributors_url":"https://api.github.com/repos/melas123/CookingRecipe/contributors","subscribers_url":"https://api.github.com/repos/melas123/CookingRecipe/subscribers","subscription_url":"https://api.github.com/repos/melas123/CookingRecipe/subscription","commits_url":"https://api.github.com/repos/melas123/CookingRecipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/melas123/CookingRecipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/melas123/CookingRecipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/melas123/CookingRecipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/melas123/CookingRecipe/contents/{+path}","compare_url":"https://api.github.com/repos/melas123/CookingRecipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/melas123/CookingRecipe/merges","archive_url":"https://api.github.com/repos/melas123/CookingRecipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/melas123/CookingRecipe/downloads","issues_url":"https://api.github.com/repos/melas123/CookingRecipe/issues{/number}","pulls_url":"https://api.github.com/repos/melas123/CookingRecipe/pulls{/number}","milestones_url":"https://api.github.com/repos/melas123/CookingRecipe/milestones{/number}","notifications_url":"https://api.github.com/repos/melas123/CookingRecipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/melas123/CookingRecipe/labels{/name}","releases_url":"https://api.github.com/repos/melas123/CookingRecipe/releases{/id}","created_at":"2016-01-18T10:05:55Z","updated_at":"2016-01-18T10:09:41Z","pushed_at":"2016-01-19T09:00:29Z","git_url":"git://github.com/melas123/CookingRecipe.git","ssh_url":"git@github.com:melas123/CookingRecipe.git","clone_url":"https://github.com/melas123/CookingRecipe.git","svn_url":"https://github.com/melas123/CookingRecipe","homepage":null,"size":309,"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/melas123/CookingRecipe/pulls/4"},"html":{"href":"https://github.com/melas123/CookingRecipe/pull/4"},"issue":{"href":"https://api.github.com/repos/melas123/CookingRecipe/issues/4"},"comments":{"href":"https://api.github.com/repos/melas123/CookingRecipe/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/melas123/CookingRecipe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/melas123/CookingRecipe/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/melas123/CookingRecipe/statuses/db8993974cf27fab2124bebec8cc25b15a3df642"}}}}