{"action":"created","comment":{"url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/comments/45030804","id":45030804,"diff_hunk":"@@ -1,16 +1,59 @@\n class BookingsController < ApplicationController\n-\t \tdef new\n-\t \tend\n+\tbefore_action :set_booking, only: [:show, :edit, :update, :destroy]\n+\tdef new\n+\t\t@flight = Flight.find(params[:flight_id])\n+\t\t@booking = Booking.new\n+\tend\n \n-\t  def create\n-\t  end\n+\tdef create\n+\t\t@booking = Booking.new(booking_params)\n+\t\t\n+\t\trespond_to do |format|\n+\t\t     if @booking.save\n+\t\t       \tformat.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n+\t\t        \tformat.json { render :show, status: :created, location: @booking }\n+\t\t     else\n+\t\t        \tformat.html { render :new }\n+\t\t        \tformat.json { render json: @booking.errors, status: :unprocessable_entity }\n+\t\t     end\n+\t\tend\n+\tend\n \n-\t  def show\n-\t  end\n+\tdef show\n+\t\t@booking = Booking.find(params[:id])\n+\t\t@passenger = Passenger.where(booking_id: @booking.id)\n+\tend\n \n-\t  private\n+\tdef update\n+    \t\trespond_to do |format|\n+\t     \t \tif @booking.update(booking_params)\n+\t        \t\tformat.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n+\t        \t\tformat.json { render :show, status: :ok, location: @booking }\n+\t      \telse\n+\t        \t\tformat.html { render :edit }\n+\t        \t\tformat.json { render json: @booking.errors, status: :unprocessable_entity }\n+\t      \tend\n+    \t\tend\n+  \tend\n+\n+\tdef destroy\n+\t    \t@booking.destroy\n+\t    \trespond_to do |format|\n+\t      \tformat.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n+\t      \tformat.json { head :no_content }\n+\t    \tend\n+\tend\n+\tprivate\n+\tdef set_booking\n+      \t@booking = Booking.find(params[:id])\n+    \tend\n \n-\t  def whitelist_params\n-\t    params.require(:booking).permit(:flight_id, passengers_attributes: [:name, :email])\n+\tdef booking_params","path":"app/controllers/bookings_controller.rb","position":60,"original_position":60,"commit_id":"07e1153407826b9cb84be02b4862d6b7db5feb65","original_commit_id":"07e1153407826b9cb84be02b4862d6b7db5feb65","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Tab detected.","created_at":"2015-11-17T08:03:46Z","updated_at":"2015-11-17T08:03:46Z","html_url":"https://github.com/andela-rchukwumam/flyr/pull/7#discussion_r45030804","pull_request_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/comments/45030804"},"html":{"href":"https://github.com/andela-rchukwumam/flyr/pull/7#discussion_r45030804"},"pull_request":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7","id":50915097,"html_url":"https://github.com/andela-rchukwumam/flyr/pull/7","diff_url":"https://github.com/andela-rchukwumam/flyr/pull/7.diff","patch_url":"https://github.com/andela-rchukwumam/flyr/pull/7.patch","issue_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/7","number":7,"state":"closed","locked":false,"title":"Feature/booking","user":{"login":"andela-rchukwumam","id":13197885,"avatar_url":"https://avatars.githubusercontent.com/u/13197885?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-rchukwumam","html_url":"https://github.com/andela-rchukwumam","followers_url":"https://api.github.com/users/andela-rchukwumam/followers","following_url":"https://api.github.com/users/andela-rchukwumam/following{/other_user}","gists_url":"https://api.github.com/users/andela-rchukwumam/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-rchukwumam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-rchukwumam/subscriptions","organizations_url":"https://api.github.com/users/andela-rchukwumam/orgs","repos_url":"https://api.github.com/users/andela-rchukwumam/repos","events_url":"https://api.github.com/users/andela-rchukwumam/events{/privacy}","received_events_url":"https://api.github.com/users/andela-rchukwumam/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-17T08:03:38Z","updated_at":"2015-11-17T08:03:46Z","closed_at":"2015-11-17T08:03:44Z","merged_at":"2015-11-17T08:03:44Z","merge_commit_sha":"a0a461d293490fe628b3c48e1d65bdb304569e0a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7/commits","review_comments_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7/comments","review_comment_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/7/comments","statuses_url":"https://api.github.com/repos/andela-rchukwumam/flyr/statuses/07e1153407826b9cb84be02b4862d6b7db5feb65","head":{"label":"andela-rchukwumam:feature/booking","ref":"feature/booking","sha":"07e1153407826b9cb84be02b4862d6b7db5feb65","user":{"login":"andela-rchukwumam","id":13197885,"avatar_url":"https://avatars.githubusercontent.com/u/13197885?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-rchukwumam","html_url":"https://github.com/andela-rchukwumam","followers_url":"https://api.github.com/users/andela-rchukwumam/followers","following_url":"https://api.github.com/users/andela-rchukwumam/following{/other_user}","gists_url":"https://api.github.com/users/andela-rchukwumam/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-rchukwumam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-rchukwumam/subscriptions","organizations_url":"https://api.github.com/users/andela-rchukwumam/orgs","repos_url":"https://api.github.com/users/andela-rchukwumam/repos","events_url":"https://api.github.com/users/andela-rchukwumam/events{/privacy}","received_events_url":"https://api.github.com/users/andela-rchukwumam/received_events","type":"User","site_admin":false},"repo":{"id":45170024,"name":"flyr","full_name":"andela-rchukwumam/flyr","owner":{"login":"andela-rchukwumam","id":13197885,"avatar_url":"https://avatars.githubusercontent.com/u/13197885?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-rchukwumam","html_url":"https://github.com/andela-rchukwumam","followers_url":"https://api.github.com/users/andela-rchukwumam/followers","following_url":"https://api.github.com/users/andela-rchukwumam/following{/other_user}","gists_url":"https://api.github.com/users/andela-rchukwumam/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-rchukwumam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-rchukwumam/subscriptions","organizations_url":"https://api.github.com/users/andela-rchukwumam/orgs","repos_url":"https://api.github.com/users/andela-rchukwumam/repos","events_url":"https://api.github.com/users/andela-rchukwumam/events{/privacy}","received_events_url":"https://api.github.com/users/andela-rchukwumam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-rchukwumam/flyr","description":"","fork":false,"url":"https://api.github.com/repos/andela-rchukwumam/flyr","forks_url":"https://api.github.com/repos/andela-rchukwumam/flyr/forks","keys_url":"https://api.github.com/repos/andela-rchukwumam/flyr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-rchukwumam/flyr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-rchukwumam/flyr/teams","hooks_url":"https://api.github.com/repos/andela-rchukwumam/flyr/hooks","issue_events_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/events{/number}","events_url":"https://api.github.com/repos/andela-rchukwumam/flyr/events","assignees_url":"https://api.github.com/repos/andela-rchukwumam/flyr/assignees{/user}","branches_url":"https://api.github.com/repos/andela-rchukwumam/flyr/branches{/branch}","tags_url":"https://api.github.com/repos/andela-rchukwumam/flyr/tags","blobs_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-rchukwumam/flyr/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-rchukwumam/flyr/languages","stargazers_url":"https://api.github.com/repos/andela-rchukwumam/flyr/stargazers","contributors_url":"https://api.github.com/repos/andela-rchukwumam/flyr/contributors","subscribers_url":"https://api.github.com/repos/andela-rchukwumam/flyr/subscribers","subscription_url":"https://api.github.com/repos/andela-rchukwumam/flyr/subscription","commits_url":"https://api.github.com/repos/andela-rchukwumam/flyr/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-rchukwumam/flyr/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-rchukwumam/flyr/contents/{+path}","compare_url":"https://api.github.com/repos/andela-rchukwumam/flyr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-rchukwumam/flyr/merges","archive_url":"https://api.github.com/repos/andela-rchukwumam/flyr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-rchukwumam/flyr/downloads","issues_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues{/number}","pulls_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-rchukwumam/flyr/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-rchukwumam/flyr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-rchukwumam/flyr/labels{/name}","releases_url":"https://api.github.com/repos/andela-rchukwumam/flyr/releases{/id}","created_at":"2015-10-29T08:26:51Z","updated_at":"2015-10-29T08:29:36Z","pushed_at":"2015-11-17T08:03:45Z","git_url":"git://github.com/andela-rchukwumam/flyr.git","ssh_url":"git@github.com:andela-rchukwumam/flyr.git","clone_url":"https://github.com/andela-rchukwumam/flyr.git","svn_url":"https://github.com/andela-rchukwumam/flyr","homepage":null,"size":613,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"andela-rchukwumam:master","ref":"master","sha":"5016b7b1b391d65679834f0f94a49fd032534132","user":{"login":"andela-rchukwumam","id":13197885,"avatar_url":"https://avatars.githubusercontent.com/u/13197885?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-rchukwumam","html_url":"https://github.com/andela-rchukwumam","followers_url":"https://api.github.com/users/andela-rchukwumam/followers","following_url":"https://api.github.com/users/andela-rchukwumam/following{/other_user}","gists_url":"https://api.github.com/users/andela-rchukwumam/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-rchukwumam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-rchukwumam/subscriptions","organizations_url":"https://api.github.com/users/andela-rchukwumam/orgs","repos_url":"https://api.github.com/users/andela-rchukwumam/repos","events_url":"https://api.github.com/users/andela-rchukwumam/events{/privacy}","received_events_url":"https://api.github.com/users/andela-rchukwumam/received_events","type":"User","site_admin":false},"repo":{"id":45170024,"name":"flyr","full_name":"andela-rchukwumam/flyr","owner":{"login":"andela-rchukwumam","id":13197885,"avatar_url":"https://avatars.githubusercontent.com/u/13197885?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-rchukwumam","html_url":"https://github.com/andela-rchukwumam","followers_url":"https://api.github.com/users/andela-rchukwumam/followers","following_url":"https://api.github.com/users/andela-rchukwumam/following{/other_user}","gists_url":"https://api.github.com/users/andela-rchukwumam/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-rchukwumam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-rchukwumam/subscriptions","organizations_url":"https://api.github.com/users/andela-rchukwumam/orgs","repos_url":"https://api.github.com/users/andela-rchukwumam/repos","events_url":"https://api.github.com/users/andela-rchukwumam/events{/privacy}","received_events_url":"https://api.github.com/users/andela-rchukwumam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-rchukwumam/flyr","description":"","fork":false,"url":"https://api.github.com/repos/andela-rchukwumam/flyr","forks_url":"https://api.github.com/repos/andela-rchukwumam/flyr/forks","keys_url":"https://api.github.com/repos/andela-rchukwumam/flyr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-rchukwumam/flyr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-rchukwumam/flyr/teams","hooks_url":"https://api.github.com/repos/andela-rchukwumam/flyr/hooks","issue_events_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/events{/number}","events_url":"https://api.github.com/repos/andela-rchukwumam/flyr/events","assignees_url":"https://api.github.com/repos/andela-rchukwumam/flyr/assignees{/user}","branches_url":"https://api.github.com/repos/andela-rchukwumam/flyr/branches{/branch}","tags_url":"https://api.github.com/repos/andela-rchukwumam/flyr/tags","blobs_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-rchukwumam/flyr/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-rchukwumam/flyr/languages","stargazers_url":"https://api.github.com/repos/andela-rchukwumam/flyr/stargazers","contributors_url":"https://api.github.com/repos/andela-rchukwumam/flyr/contributors","subscribers_url":"https://api.github.com/repos/andela-rchukwumam/flyr/subscribers","subscription_url":"https://api.github.com/repos/andela-rchukwumam/flyr/subscription","commits_url":"https://api.github.com/repos/andela-rchukwumam/flyr/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-rchukwumam/flyr/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-rchukwumam/flyr/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-rchukwumam/flyr/contents/{+path}","compare_url":"https://api.github.com/repos/andela-rchukwumam/flyr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-rchukwumam/flyr/merges","archive_url":"https://api.github.com/repos/andela-rchukwumam/flyr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-rchukwumam/flyr/downloads","issues_url":"https://api.github.com/repos/andela-rchukwumam/flyr/issues{/number}","pulls_url":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-rchukwumam/flyr/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-rchukwumam/flyr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-rchukwumam/flyr/labels{/name}","releases_url":"https://api.github.com/repos/andela-rchukwumam/flyr/releases{/id}","created_at":"2015-10-29T08:26:51Z","updated_at":"2015-10-29T08:29:36Z","pushed_at":"2015-11-17T08:03:45Z","git_url":"git://github.com/andela-rchukwumam/flyr.git","ssh_url":"git@github.com:andela-rchukwumam/flyr.git","clone_url":"https://github.com/andela-rchukwumam/flyr.git","svn_url":"https://github.com/andela-rchukwumam/flyr","homepage":null,"size":613,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7"},"html":{"href":"https://github.com/andela-rchukwumam/flyr/pull/7"},"issue":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/7"},"comments":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/andela-rchukwumam/flyr/statuses/07e1153407826b9cb84be02b4862d6b7db5feb65"}}}}