{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments/36880812","id":36880812,"diff_hunk":"@@ -0,0 +1,57 @@\n+class OrdersController < ApplicationController\n+    before_action :order_page_access, only: [:index]\n+\n+  def index\n+    @merchant = session[:user_id]\n+    @orders = Order.includes(:order_items).where(order_items: { user_id: @merchant } )\n+    # @order_item = OrderItem.find(params[:id])\n+\n+    if params[:status] == \"paid\"\n+      @orders = @orders.where(\"status = ?\", \"paid\")\n+    elsif params[:status] == \"complete\"\n+      @orders = @orders.where(\"status = ?\", \"Complete\")\n+    end\n+    render :index\n+  end\n+\n+\n+  def edit\n+    @order = Order.find(session[:order_id])","path":"app/controllers/orders_controller.rb","position":19,"original_position":19,"commit_id":"aaecf832b5ad47bdf4181a93cf8117425643116a","original_commit_id":"aaecf832b5ad47bdf4181a93cf8117425643116a","user":{"login":"kariabancroft","id":7269204,"avatar_url":"https://avatars.githubusercontent.com/u/7269204?v=3","gravatar_id":"","url":"https://api.github.com/users/kariabancroft","html_url":"https://github.com/kariabancroft","followers_url":"https://api.github.com/users/kariabancroft/followers","following_url":"https://api.github.com/users/kariabancroft/following{/other_user}","gists_url":"https://api.github.com/users/kariabancroft/gists{/gist_id}","starred_url":"https://api.github.com/users/kariabancroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kariabancroft/subscriptions","organizations_url":"https://api.github.com/users/kariabancroft/orgs","repos_url":"https://api.github.com/users/kariabancroft/repos","events_url":"https://api.github.com/users/kariabancroft/events{/privacy}","received_events_url":"https://api.github.com/users/kariabancroft/received_events","type":"User","site_admin":false},"body":"Lots of duplication in this `find` method call so i'd add a `before_action` for each of these controller actions","created_at":"2015-08-12T16:25:47Z","updated_at":"2015-08-12T16:25:47Z","html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19#discussion_r36880812","pull_request_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments/36880812"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19#discussion_r36880812"},"pull_request":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19","id":40822975,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19","diff_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19.diff","patch_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19.patch","issue_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/19","number":19,"state":"open","locked":false,"title":"Petcessories Week 2: Team Petsy","user":{"login":"lorainekv","id":11144527,"avatar_url":"https://avatars.githubusercontent.com/u/11144527?v=3","gravatar_id":"","url":"https://api.github.com/users/lorainekv","html_url":"https://github.com/lorainekv","followers_url":"https://api.github.com/users/lorainekv/followers","following_url":"https://api.github.com/users/lorainekv/following{/other_user}","gists_url":"https://api.github.com/users/lorainekv/gists{/gist_id}","starred_url":"https://api.github.com/users/lorainekv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorainekv/subscriptions","organizations_url":"https://api.github.com/users/lorainekv/orgs","repos_url":"https://api.github.com/users/lorainekv/repos","events_url":"https://api.github.com/users/lorainekv/events{/privacy}","received_events_url":"https://api.github.com/users/lorainekv/received_events","type":"User","site_admin":false},"body":"Members: @lilagrc @MisShellyMac @wangg131 and @lorainekv\r\n\r\nWe rocked it! \r\n\r\nhttp://pacific-hamlet-1199.herokuapp.com","created_at":"2015-07-24T22:49:38Z","updated_at":"2015-08-12T16:25:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"394a0aeaa19769e31946dc723f3832f10eb2cf13","assignee":{"login":"kariabancroft","id":7269204,"avatar_url":"https://avatars.githubusercontent.com/u/7269204?v=3","gravatar_id":"","url":"https://api.github.com/users/kariabancroft","html_url":"https://github.com/kariabancroft","followers_url":"https://api.github.com/users/kariabancroft/followers","following_url":"https://api.github.com/users/kariabancroft/following{/other_user}","gists_url":"https://api.github.com/users/kariabancroft/gists{/gist_id}","starred_url":"https://api.github.com/users/kariabancroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kariabancroft/subscriptions","organizations_url":"https://api.github.com/users/kariabancroft/orgs","repos_url":"https://api.github.com/users/kariabancroft/repos","events_url":"https://api.github.com/users/kariabancroft/events{/privacy}","received_events_url":"https://api.github.com/users/kariabancroft/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19/commits","review_comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19/comments","review_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/19/comments","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/aaecf832b5ad47bdf4181a93cf8117425643116a","head":{"label":"lorainekv:team-petsy/master","ref":"team-petsy/master","sha":"aaecf832b5ad47bdf4181a93cf8117425643116a","user":{"login":"lorainekv","id":11144527,"avatar_url":"https://avatars.githubusercontent.com/u/11144527?v=3","gravatar_id":"","url":"https://api.github.com/users/lorainekv","html_url":"https://github.com/lorainekv","followers_url":"https://api.github.com/users/lorainekv/followers","following_url":"https://api.github.com/users/lorainekv/following{/other_user}","gists_url":"https://api.github.com/users/lorainekv/gists{/gist_id}","starred_url":"https://api.github.com/users/lorainekv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorainekv/subscriptions","organizations_url":"https://api.github.com/users/lorainekv/orgs","repos_url":"https://api.github.com/users/lorainekv/repos","events_url":"https://api.github.com/users/lorainekv/events{/privacy}","received_events_url":"https://api.github.com/users/lorainekv/received_events","type":"User","site_admin":false},"repo":{"id":39098735,"name":"C3Projects--bEtsy","full_name":"lorainekv/C3Projects--bEtsy","owner":{"login":"lorainekv","id":11144527,"avatar_url":"https://avatars.githubusercontent.com/u/11144527?v=3","gravatar_id":"","url":"https://api.github.com/users/lorainekv","html_url":"https://github.com/lorainekv","followers_url":"https://api.github.com/users/lorainekv/followers","following_url":"https://api.github.com/users/lorainekv/following{/other_user}","gists_url":"https://api.github.com/users/lorainekv/gists{/gist_id}","starred_url":"https://api.github.com/users/lorainekv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorainekv/subscriptions","organizations_url":"https://api.github.com/users/lorainekv/orgs","repos_url":"https://api.github.com/users/lorainekv/repos","events_url":"https://api.github.com/users/lorainekv/events{/privacy}","received_events_url":"https://api.github.com/users/lorainekv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lorainekv/C3Projects--bEtsy","description":"","fork":true,"url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy","forks_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/forks","keys_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/teams","hooks_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/hooks","issue_events_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/issues/events{/number}","events_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/events","assignees_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/assignees{/user}","branches_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/branches{/branch}","tags_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/tags","blobs_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/statuses/{sha}","languages_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/languages","stargazers_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/stargazers","contributors_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/contributors","subscribers_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/subscribers","subscription_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/subscription","commits_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/contents/{+path}","compare_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/merges","archive_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/downloads","issues_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/issues{/number}","pulls_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/pulls{/number}","milestones_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/milestones{/number}","notifications_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/labels{/name}","releases_url":"https://api.github.com/repos/lorainekv/C3Projects--bEtsy/releases{/id}","created_at":"2015-07-14T20:29:07Z","updated_at":"2015-07-13T20:24:12Z","pushed_at":"2015-07-24T21:06:23Z","git_url":"git://github.com/lorainekv/C3Projects--bEtsy.git","ssh_url":"git@github.com:lorainekv/C3Projects--bEtsy.git","clone_url":"https://github.com/lorainekv/C3Projects--bEtsy.git","svn_url":"https://github.com/lorainekv/C3Projects--bEtsy","homepage":null,"size":5780,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"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":"Ada-Developers-Academy:team-petsy-new/master","ref":"team-petsy-new/master","sha":"6f7dc8ac081d5ae0dd9dd82fad3cf296c8e5a8be","user":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"repo":{"id":39035434,"name":"C3Projects--bEtsy","full_name":"Ada-Developers-Academy/C3Projects--bEtsy","owner":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy","description":"","fork":false,"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy","forks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/forks","keys_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/teams","hooks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/hooks","issue_events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/events","assignees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/tags","blobs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/languages","stargazers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/stargazers","contributors_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/contributors","subscribers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/subscribers","subscription_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/subscription","commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/merges","archive_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/downloads","issues_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/labels{/name}","releases_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/releases{/id}","created_at":"2015-07-13T20:24:12Z","updated_at":"2015-07-19T07:18:36Z","pushed_at":"2015-07-24T22:50:57Z","git_url":"git://github.com/Ada-Developers-Academy/C3Projects--bEtsy.git","ssh_url":"git@github.com:Ada-Developers-Academy/C3Projects--bEtsy.git","clone_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy.git","svn_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy","homepage":null,"size":25308,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":6,"forks":8,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/19"},"issue":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/19"},"comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/aaecf832b5ad47bdf4181a93cf8117425643116a"}}}}