{"action":"created","comment":{"url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/comments/48344933","id":48344933,"diff_hunk":"@@ -1,22 +1,71 @@\n module Api\n   module V1\n     class BucketlistsController < ApplicationController\n-      before_action :authenticate_token\n+      include UpdateHandler\n+\n+      before_action :get_current_bucketlist, only: [:show, :update, :destroy]\n \n       def index\n+        bucketlists = @current_user.bucketlists\n+        display_all bucketlists\n       end\n \n       def create\n+        bucketlist = Bucketlist.new(\n+          name: params[:name],\n+          user_id: @current_user.id\n+        )\n+        save bucketlist\n       end\n \n       def show\n+        render json: @bucketlist.to_json(include: :items)\n       end\n \n       def update\n+        return if params_arg_length_is_zero\n+        if @bucketlist.update bucketlist_params\n+          render json: { \"message\": \"Bucketlist updated successfully\" }\n+        else\n+          render json: { \"message\": @bucketlist.get_error },\n+                 status: 400\n+        end\n       end\n \n       def destroy\n+        @bucketlist.destroy\n+        render json: { \"message\": \"Bucketlist deleted successfully\" }\n       end\n+\n+      private\n+\n+        def get_current_bucketlist\n+          @bucketlist = Bucketlist.find_by_id(params[:id])\n+          render json: { \"message\": \"Invalid ID. Bucketlist not found.\" },\n+                 status: 404 if @bucketlist.nil?\n+        end\n+\n+        def bucketlist_params","path":"app/controllers/api/v1/bucketlists_controller.rb","position":49,"original_position":49,"commit_id":"1eaea8bc02d18925ee81dd8b02d6ce033280592e","original_commit_id":"1eaea8bc02d18925ee81dd8b02d6ce033280592e","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":"Inconsistent indentation detected.","created_at":"2015-12-23T13:35:17Z","updated_at":"2015-12-23T13:35:17Z","html_url":"https://github.com/andela-toduah/apibucket/pull/17#discussion_r48344933","pull_request_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/comments/48344933"},"html":{"href":"https://github.com/andela-toduah/apibucket/pull/17#discussion_r48344933"},"pull_request":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17","id":54469723,"html_url":"https://github.com/andela-toduah/apibucket/pull/17","diff_url":"https://github.com/andela-toduah/apibucket/pull/17.diff","patch_url":"https://github.com/andela-toduah/apibucket/pull/17.patch","issue_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/17","number":17,"state":"open","locked":false,"title":"Functionality To Controllers [Finishes ##110318038]","user":{"login":"andela-toduah","id":15727582,"avatar_url":"https://avatars.githubusercontent.com/u/15727582?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-toduah","html_url":"https://github.com/andela-toduah","followers_url":"https://api.github.com/users/andela-toduah/followers","following_url":"https://api.github.com/users/andela-toduah/following{/other_user}","gists_url":"https://api.github.com/users/andela-toduah/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-toduah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-toduah/subscriptions","organizations_url":"https://api.github.com/users/andela-toduah/orgs","repos_url":"https://api.github.com/users/andela-toduah/repos","events_url":"https://api.github.com/users/andela-toduah/events{/privacy}","received_events_url":"https://api.github.com/users/andela-toduah/received_events","type":"User","site_admin":false},"body":"Add functionality to methods defined in controllers.\r\nWrite tests to test functionality implemented.\r\nClean up code into concerns in accordance with best practices for design patterns","created_at":"2015-12-23T13:35:08Z","updated_at":"2015-12-23T13:35:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95596a0f028a90540f1d2c20d404d70b4344e05b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17/commits","review_comments_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17/comments","review_comment_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/17/comments","statuses_url":"https://api.github.com/repos/andela-toduah/apibucket/statuses/1eaea8bc02d18925ee81dd8b02d6ce033280592e","head":{"label":"andela-toduah:ft-controller-function-110318038","ref":"ft-controller-function-110318038","sha":"1eaea8bc02d18925ee81dd8b02d6ce033280592e","user":{"login":"andela-toduah","id":15727582,"avatar_url":"https://avatars.githubusercontent.com/u/15727582?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-toduah","html_url":"https://github.com/andela-toduah","followers_url":"https://api.github.com/users/andela-toduah/followers","following_url":"https://api.github.com/users/andela-toduah/following{/other_user}","gists_url":"https://api.github.com/users/andela-toduah/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-toduah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-toduah/subscriptions","organizations_url":"https://api.github.com/users/andela-toduah/orgs","repos_url":"https://api.github.com/users/andela-toduah/repos","events_url":"https://api.github.com/users/andela-toduah/events{/privacy}","received_events_url":"https://api.github.com/users/andela-toduah/received_events","type":"User","site_admin":false},"repo":{"id":48051370,"name":"apibucket","full_name":"andela-toduah/apibucket","owner":{"login":"andela-toduah","id":15727582,"avatar_url":"https://avatars.githubusercontent.com/u/15727582?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-toduah","html_url":"https://github.com/andela-toduah","followers_url":"https://api.github.com/users/andela-toduah/followers","following_url":"https://api.github.com/users/andela-toduah/following{/other_user}","gists_url":"https://api.github.com/users/andela-toduah/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-toduah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-toduah/subscriptions","organizations_url":"https://api.github.com/users/andela-toduah/orgs","repos_url":"https://api.github.com/users/andela-toduah/repos","events_url":"https://api.github.com/users/andela-toduah/events{/privacy}","received_events_url":"https://api.github.com/users/andela-toduah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-toduah/apibucket","description":"API endpoint for Bucketlists.","fork":false,"url":"https://api.github.com/repos/andela-toduah/apibucket","forks_url":"https://api.github.com/repos/andela-toduah/apibucket/forks","keys_url":"https://api.github.com/repos/andela-toduah/apibucket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-toduah/apibucket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-toduah/apibucket/teams","hooks_url":"https://api.github.com/repos/andela-toduah/apibucket/hooks","issue_events_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/events{/number}","events_url":"https://api.github.com/repos/andela-toduah/apibucket/events","assignees_url":"https://api.github.com/repos/andela-toduah/apibucket/assignees{/user}","branches_url":"https://api.github.com/repos/andela-toduah/apibucket/branches{/branch}","tags_url":"https://api.github.com/repos/andela-toduah/apibucket/tags","blobs_url":"https://api.github.com/repos/andela-toduah/apibucket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-toduah/apibucket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-toduah/apibucket/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-toduah/apibucket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-toduah/apibucket/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-toduah/apibucket/languages","stargazers_url":"https://api.github.com/repos/andela-toduah/apibucket/stargazers","contributors_url":"https://api.github.com/repos/andela-toduah/apibucket/contributors","subscribers_url":"https://api.github.com/repos/andela-toduah/apibucket/subscribers","subscription_url":"https://api.github.com/repos/andela-toduah/apibucket/subscription","commits_url":"https://api.github.com/repos/andela-toduah/apibucket/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-toduah/apibucket/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-toduah/apibucket/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-toduah/apibucket/contents/{+path}","compare_url":"https://api.github.com/repos/andela-toduah/apibucket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-toduah/apibucket/merges","archive_url":"https://api.github.com/repos/andela-toduah/apibucket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-toduah/apibucket/downloads","issues_url":"https://api.github.com/repos/andela-toduah/apibucket/issues{/number}","pulls_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-toduah/apibucket/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-toduah/apibucket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-toduah/apibucket/labels{/name}","releases_url":"https://api.github.com/repos/andela-toduah/apibucket/releases{/id}","created_at":"2015-12-15T15:25:23Z","updated_at":"2015-12-15T15:34:07Z","pushed_at":"2015-12-23T13:35:08Z","git_url":"git://github.com/andela-toduah/apibucket.git","ssh_url":"git@github.com:andela-toduah/apibucket.git","clone_url":"https://github.com/andela-toduah/apibucket.git","svn_url":"https://github.com/andela-toduah/apibucket","homepage":null,"size":49,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"andela-toduah:master","ref":"master","sha":"7b3c9c98603d5244135383c014c5b4a73011c218","user":{"login":"andela-toduah","id":15727582,"avatar_url":"https://avatars.githubusercontent.com/u/15727582?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-toduah","html_url":"https://github.com/andela-toduah","followers_url":"https://api.github.com/users/andela-toduah/followers","following_url":"https://api.github.com/users/andela-toduah/following{/other_user}","gists_url":"https://api.github.com/users/andela-toduah/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-toduah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-toduah/subscriptions","organizations_url":"https://api.github.com/users/andela-toduah/orgs","repos_url":"https://api.github.com/users/andela-toduah/repos","events_url":"https://api.github.com/users/andela-toduah/events{/privacy}","received_events_url":"https://api.github.com/users/andela-toduah/received_events","type":"User","site_admin":false},"repo":{"id":48051370,"name":"apibucket","full_name":"andela-toduah/apibucket","owner":{"login":"andela-toduah","id":15727582,"avatar_url":"https://avatars.githubusercontent.com/u/15727582?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-toduah","html_url":"https://github.com/andela-toduah","followers_url":"https://api.github.com/users/andela-toduah/followers","following_url":"https://api.github.com/users/andela-toduah/following{/other_user}","gists_url":"https://api.github.com/users/andela-toduah/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-toduah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-toduah/subscriptions","organizations_url":"https://api.github.com/users/andela-toduah/orgs","repos_url":"https://api.github.com/users/andela-toduah/repos","events_url":"https://api.github.com/users/andela-toduah/events{/privacy}","received_events_url":"https://api.github.com/users/andela-toduah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-toduah/apibucket","description":"API endpoint for Bucketlists.","fork":false,"url":"https://api.github.com/repos/andela-toduah/apibucket","forks_url":"https://api.github.com/repos/andela-toduah/apibucket/forks","keys_url":"https://api.github.com/repos/andela-toduah/apibucket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-toduah/apibucket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-toduah/apibucket/teams","hooks_url":"https://api.github.com/repos/andela-toduah/apibucket/hooks","issue_events_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/events{/number}","events_url":"https://api.github.com/repos/andela-toduah/apibucket/events","assignees_url":"https://api.github.com/repos/andela-toduah/apibucket/assignees{/user}","branches_url":"https://api.github.com/repos/andela-toduah/apibucket/branches{/branch}","tags_url":"https://api.github.com/repos/andela-toduah/apibucket/tags","blobs_url":"https://api.github.com/repos/andela-toduah/apibucket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-toduah/apibucket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-toduah/apibucket/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-toduah/apibucket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-toduah/apibucket/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-toduah/apibucket/languages","stargazers_url":"https://api.github.com/repos/andela-toduah/apibucket/stargazers","contributors_url":"https://api.github.com/repos/andela-toduah/apibucket/contributors","subscribers_url":"https://api.github.com/repos/andela-toduah/apibucket/subscribers","subscription_url":"https://api.github.com/repos/andela-toduah/apibucket/subscription","commits_url":"https://api.github.com/repos/andela-toduah/apibucket/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-toduah/apibucket/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-toduah/apibucket/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-toduah/apibucket/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-toduah/apibucket/contents/{+path}","compare_url":"https://api.github.com/repos/andela-toduah/apibucket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-toduah/apibucket/merges","archive_url":"https://api.github.com/repos/andela-toduah/apibucket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-toduah/apibucket/downloads","issues_url":"https://api.github.com/repos/andela-toduah/apibucket/issues{/number}","pulls_url":"https://api.github.com/repos/andela-toduah/apibucket/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-toduah/apibucket/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-toduah/apibucket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-toduah/apibucket/labels{/name}","releases_url":"https://api.github.com/repos/andela-toduah/apibucket/releases{/id}","created_at":"2015-12-15T15:25:23Z","updated_at":"2015-12-15T15:34:07Z","pushed_at":"2015-12-23T13:35:08Z","git_url":"git://github.com/andela-toduah/apibucket.git","ssh_url":"git@github.com:andela-toduah/apibucket.git","clone_url":"https://github.com/andela-toduah/apibucket.git","svn_url":"https://github.com/andela-toduah/apibucket","homepage":null,"size":49,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17"},"html":{"href":"https://github.com/andela-toduah/apibucket/pull/17"},"issue":{"href":"https://api.github.com/repos/andela-toduah/apibucket/issues/17"},"comments":{"href":"https://api.github.com/repos/andela-toduah/apibucket/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela-toduah/apibucket/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/andela-toduah/apibucket/statuses/1eaea8bc02d18925ee81dd8b02d6ce033280592e"}}}}