GitHub PullRequestReviewCommentEvent at 2014-06-27 14:51:42
Repository: food_trucks
Actor: HeroicEric
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/comments/14296236","id":14296236,"diff_hunk":"@@ -1,10 +1,61 @@\n class FoodTrucksController < ApplicationController\n   def index\n-    @food_trucks = FoodTruck.order(:created_at).page(params[:page])\n+    @food_trucks = FoodTruck.order(created_at: :desc).page(params[:page])\n   end\n \n   def show\n     @food_truck = FoodTruck.find(params[:id])\n     @review = Review.new\n   end\n+\n+  def create\n+    @food_truck = FoodTruck.new(food_truck_params)\n+    @food_truck.user = current_user\n+\n+    if @food_truck.save\n+      redirect_to '/food_trucks'\n+    else\n+      flash.now[:notice] = 'Uh oh! Your food truck could not be saved.'\n+      render :new\n+    end\n+  end\n+\n+  def new\n+    if !user_signed_in?","path":"app/controllers/food_trucks_controller.rb","position":25,"original_position":25,"commit_id":"1309dcc5316a379ca7d999b8242a680acab9b593","original_commit_id":"1309dcc5316a379ca7d999b8242a680acab9b593","user":{"login":"HeroicEric","id":602204,"avatar_url":"https://avatars.githubusercontent.com/u/602204?","gravatar_id":"a6f6992a2f3ddf529f52e084346ddfce","url":"https://api.github.com/users/HeroicEric","html_url":"https://github.com/HeroicEric","followers_url":"https://api.github.com/users/HeroicEric/followers","following_url":"https://api.github.com/users/HeroicEric/following{/other_user}","gists_url":"https://api.github.com/users/HeroicEric/gists{/gist_id}","starred_url":"https://api.github.com/users/HeroicEric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeroicEric/subscriptions","organizations_url":"https://api.github.com/users/HeroicEric/orgs","repos_url":"https://api.github.com/users/HeroicEric/repos","events_url":"https://api.github.com/users/HeroicEric/events{/privacy}","received_events_url":"https://api.github.com/users/HeroicEric/received_events","type":"User","site_admin":false},"body":"We should use Devise's `authenticate_user!` for this\r\n\r\nhttps://github.com/plataformatec/devise#controller-filters-and-helpers\r\n\r\nAt the top of your controller you can specify which actions should require an euthenticated user with:\r\n\r\n```ruby\r\nclass FoodTrucksController < ApplicationController\r\n  before_action :authenticate_user, except: [:index, :show]\r\n # blah\r\nend\r\n```\r\n\r\nThis will run Devise's `authenticate_user!` method before the specific controller actions are run.","created_at":"2014-06-27T14:51:42Z","updated_at":"2014-06-27T14:51:42Z","html_url":"https://github.com/LaunchAcademy/food_trucks/pull/41#discussion_r14296236","pull_request_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/comments/14296236"},"html":{"href":"https://github.com/LaunchAcademy/food_trucks/pull/41#discussion_r14296236"},"pull_request":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41","id":17675637,"html_url":"https://github.com/LaunchAcademy/food_trucks/pull/41","diff_url":"https://github.com/LaunchAcademy/food_trucks/pull/41.diff","patch_url":"https://github.com/LaunchAcademy/food_trucks/pull/41.patch","issue_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/41","number":41,"state":"open","title":"add remove trucks","user":{"login":"sskates1","id":6914663,"avatar_url":"https://avatars.githubusercontent.com/u/6914663?","gravatar_id":"ded9094e97d204483d11693ac4ffb526","url":"https://api.github.com/users/sskates1","html_url":"https://github.com/sskates1","followers_url":"https://api.github.com/users/sskates1/followers","following_url":"https://api.github.com/users/sskates1/following{/other_user}","gists_url":"https://api.github.com/users/sskates1/gists{/gist_id}","starred_url":"https://api.github.com/users/sskates1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskates1/subscriptions","organizations_url":"https://api.github.com/users/sskates1/orgs","repos_url":"https://api.github.com/users/sskates1/repos","events_url":"https://api.github.com/users/sskates1/events{/privacy}","received_events_url":"https://api.github.com/users/sskates1/received_events","type":"User","site_admin":false},"body":"#40 ","created_at":"2014-06-26T21:56:54Z","updated_at":"2014-06-27T14:51:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2a17a9e884bd6aa4ba57e8d0e2c43dde2e7c1c5","assignee":{"login":"sskates1","id":6914663,"avatar_url":"https://avatars.githubusercontent.com/u/6914663?","gravatar_id":"ded9094e97d204483d11693ac4ffb526","url":"https://api.github.com/users/sskates1","html_url":"https://github.com/sskates1","followers_url":"https://api.github.com/users/sskates1/followers","following_url":"https://api.github.com/users/sskates1/following{/other_user}","gists_url":"https://api.github.com/users/sskates1/gists{/gist_id}","starred_url":"https://api.github.com/users/sskates1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sskates1/subscriptions","organizations_url":"https://api.github.com/users/sskates1/orgs","repos_url":"https://api.github.com/users/sskates1/repos","events_url":"https://api.github.com/users/sskates1/events{/privacy}","received_events_url":"https://api.github.com/users/sskates1/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41/commits","review_comments_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41/comments","review_comment_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/comments/{number}","comments_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/41/comments","statuses_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/statuses/1309dcc5316a379ca7d999b8242a680acab9b593","head":{"label":"LaunchAcademy:add_remove_trucks","ref":"add_remove_trucks","sha":"1309dcc5316a379ca7d999b8242a680acab9b593","user":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?","gravatar_id":"3996dda93bb2ce2013929378c9ecff8d","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":21137068,"name":"food_trucks","full_name":"LaunchAcademy/food_trucks","owner":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?","gravatar_id":"3996dda93bb2ce2013929378c9ecff8d","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LaunchAcademy/food_trucks","description":"Food truck review app.","fork":false,"url":"https://api.github.com/repos/LaunchAcademy/food_trucks","forks_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/forks","keys_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/teams","hooks_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/hooks","issue_events_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/events{/number}","events_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/events","assignees_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/assignees{/user}","branches_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/branches{/branch}","tags_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/tags","blobs_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/statuses/{sha}","languages_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/languages","stargazers_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/stargazers","contributors_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/contributors","subscribers_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/subscribers","subscription_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/subscription","commits_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/comments/{number}","contents_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/contents/{+path}","compare_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/merges","archive_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/downloads","issues_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues{/number}","pulls_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls{/number}","milestones_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/milestones{/number}","notifications_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/labels{/name}","releases_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/releases{/id}","created_at":"2014-06-23T18:16:17Z","updated_at":"2014-06-25T18:15:33Z","pushed_at":"2014-06-27T14:46:42Z","git_url":"git://github.com/LaunchAcademy/food_trucks.git","ssh_url":"git@github.com:LaunchAcademy/food_trucks.git","clone_url":"https://github.com/LaunchAcademy/food_trucks.git","svn_url":"https://github.com/LaunchAcademy/food_trucks","homepage":null,"size":2002,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"LaunchAcademy:master","ref":"master","sha":"3911b593b0561ed38e4d198ec1f3cd473f48c12d","user":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?","gravatar_id":"3996dda93bb2ce2013929378c9ecff8d","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":21137068,"name":"food_trucks","full_name":"LaunchAcademy/food_trucks","owner":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?","gravatar_id":"3996dda93bb2ce2013929378c9ecff8d","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LaunchAcademy/food_trucks","description":"Food truck review app.","fork":false,"url":"https://api.github.com/repos/LaunchAcademy/food_trucks","forks_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/forks","keys_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/teams","hooks_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/hooks","issue_events_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/events{/number}","events_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/events","assignees_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/assignees{/user}","branches_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/branches{/branch}","tags_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/tags","blobs_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/statuses/{sha}","languages_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/languages","stargazers_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/stargazers","contributors_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/contributors","subscribers_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/subscribers","subscription_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/subscription","commits_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/comments/{number}","contents_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/contents/{+path}","compare_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/merges","archive_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/downloads","issues_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues{/number}","pulls_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls{/number}","milestones_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/milestones{/number}","notifications_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/labels{/name}","releases_url":"https://api.github.com/repos/LaunchAcademy/food_trucks/releases{/id}","created_at":"2014-06-23T18:16:17Z","updated_at":"2014-06-25T18:15:33Z","pushed_at":"2014-06-27T14:46:42Z","git_url":"git://github.com/LaunchAcademy/food_trucks.git","ssh_url":"git@github.com:LaunchAcademy/food_trucks.git","clone_url":"https://github.com/LaunchAcademy/food_trucks.git","svn_url":"https://github.com/LaunchAcademy/food_trucks","homepage":null,"size":2002,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41"},"html":{"href":"https://github.com/LaunchAcademy/food_trucks/pull/41"},"issue":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/41"},"comments":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/LaunchAcademy/food_trucks/statuses/1309dcc5316a379ca7d999b8242a680acab9b593"}}}}