{"action":"created","comment":{"url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/comments/71325612","id":71325612,"diff_hunk":"@@ -0,0 +1,51 @@\n+class Api::V1::InvoiceItemsSearchController < ApiBaseController\n+  respond_to :json, :xml\n+\n+  def index\n+    if invoice_item_params[:id]\n+      respond_with InvoiceItem.where(\"id = ?\", invoice_item_params[:id])\n+    elsif invoice_item_params[:quantity]\n+      respond_with InvoiceItem.where(\"quantity = ?\", invoice_item_params[:quantity])\n+    elsif invoice_item_params[:unit_price]\n+      respond_with InvoiceItem.where(\"unit_price = ?\", invoice_item_params[:unit_price])\n+    elsif invoice_item_params[:item_id]\n+      respond_with InvoiceItem.where(\"item_id = ?\", invoice_item_params[:item_id])\n+    elsif invoice_item_params[:invoice_id]\n+      respond_with InvoiceItem.where(\"invoice_id = ?\", invoice_item_params[:invoice_id])\n+    elsif invoice_item_params[:created_at]\n+      respond_with InvoiceItem.where(\"created_at = ?\", invoice_item_params[:created_at])\n+    elsif invoice_item_params[:updated_at]\n+      respond_with InvoiceItem.where(\"updated_at = ?\", invoice_item_params[:updated_at])\n+    else\n+      respond_with InvoiceItem.where(invoice_item_params)","path":"app/controllers/api/v1/invoice_items_search_controller.rb","position":20,"original_position":20,"commit_id":"53a4c384ec5f41f49dd69a13e0c6c41082e42883","original_commit_id":"53a4c384ec5f41f49dd69a13e0c6c41082e42883","user":{"login":"AnnaCW","id":17806544,"avatar_url":"https://avatars.githubusercontent.com/u/17806544?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaCW","html_url":"https://github.com/AnnaCW","followers_url":"https://api.github.com/users/AnnaCW/followers","following_url":"https://api.github.com/users/AnnaCW/following{/other_user}","gists_url":"https://api.github.com/users/AnnaCW/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaCW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaCW/subscriptions","organizations_url":"https://api.github.com/users/AnnaCW/orgs","repos_url":"https://api.github.com/users/AnnaCW/repos","events_url":"https://api.github.com/users/AnnaCW/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaCW/received_events","type":"User","site_admin":false},"body":"This comment applies to all the search controllers. \r\n--What is the catch-all doing if we have a line for each column? \r\n--Based on Postman testing, I don't think we necessarily need a separate line for every column. That said, it is probably a good idea to do it this way until we have everything properly tested. Either way, we should refactor for uniformity across our record endpoints. \r\n","created_at":"2016-07-19T12:13:28Z","updated_at":"2016-07-19T12:13:28Z","html_url":"https://github.com/AnnaCW/rails_engine/pull/21#discussion_r71325612","pull_request_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/comments/71325612"},"html":{"href":"https://github.com/AnnaCW/rails_engine/pull/21#discussion_r71325612"},"pull_request":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21","id":77920477,"html_url":"https://github.com/AnnaCW/rails_engine/pull/21","diff_url":"https://github.com/AnnaCW/rails_engine/pull/21.diff","patch_url":"https://github.com/AnnaCW/rails_engine/pull/21.patch","issue_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/21","number":21,"state":"open","locked":false,"title":"Add Record Endpoints for Invoices, Items, and InvoiceItems","user":{"login":"Riizu","id":3233168,"avatar_url":"https://avatars.githubusercontent.com/u/3233168?v=3","gravatar_id":"","url":"https://api.github.com/users/Riizu","html_url":"https://github.com/Riizu","followers_url":"https://api.github.com/users/Riizu/followers","following_url":"https://api.github.com/users/Riizu/following{/other_user}","gists_url":"https://api.github.com/users/Riizu/gists{/gist_id}","starred_url":"https://api.github.com/users/Riizu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Riizu/subscriptions","organizations_url":"https://api.github.com/users/Riizu/orgs","repos_url":"https://api.github.com/users/Riizu/repos","events_url":"https://api.github.com/users/Riizu/events{/privacy}","received_events_url":"https://api.github.com/users/Riizu/received_events","type":"User","site_admin":false},"body":"Added API endpoint for invoice items\r\n-Includes /invoice_items and /invoice_items/:id\r\n-Includes search functionality with /invoice_items/find and /invoice_items/find_all\r\n\r\nAdded API endpoint for invoices\r\n-Includes /invoices and /invoices/:id\r\n-Includes search functionality with /invoices/find and /invoices/find_all\r\n\r\nAdded API endpoint for items\r\n-Includes /items and /items/:id\r\n-Includes search functionality with /items/find and /items/find_all\r\n\r\n-Added unit tests for InvoiceItem model\r\n-Added unit tests for Invoice model\r\n-Added unit tests for Item model\r\n\r\n-Removed leftover files for minitest\r\n\r\nCloses #22, Closes #23, Closes #24","created_at":"2016-07-19T05:42:36Z","updated_at":"2016-07-19T12:13:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f6547f2db1fcefa0f5d97d5e2204dd6c16934ba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21/commits","review_comments_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21/comments","review_comment_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/21/comments","statuses_url":"https://api.github.com/repos/AnnaCW/rails_engine/statuses/53a4c384ec5f41f49dd69a13e0c6c41082e42883","head":{"label":"AnnaCW:add-invoice-items-endpoint","ref":"add-invoice-items-endpoint","sha":"53a4c384ec5f41f49dd69a13e0c6c41082e42883","user":{"login":"AnnaCW","id":17806544,"avatar_url":"https://avatars.githubusercontent.com/u/17806544?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaCW","html_url":"https://github.com/AnnaCW","followers_url":"https://api.github.com/users/AnnaCW/followers","following_url":"https://api.github.com/users/AnnaCW/following{/other_user}","gists_url":"https://api.github.com/users/AnnaCW/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaCW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaCW/subscriptions","organizations_url":"https://api.github.com/users/AnnaCW/orgs","repos_url":"https://api.github.com/users/AnnaCW/repos","events_url":"https://api.github.com/users/AnnaCW/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaCW/received_events","type":"User","site_admin":false},"repo":{"id":63630667,"name":"rails_engine","full_name":"AnnaCW/rails_engine","owner":{"login":"AnnaCW","id":17806544,"avatar_url":"https://avatars.githubusercontent.com/u/17806544?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaCW","html_url":"https://github.com/AnnaCW","followers_url":"https://api.github.com/users/AnnaCW/followers","following_url":"https://api.github.com/users/AnnaCW/following{/other_user}","gists_url":"https://api.github.com/users/AnnaCW/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaCW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaCW/subscriptions","organizations_url":"https://api.github.com/users/AnnaCW/orgs","repos_url":"https://api.github.com/users/AnnaCW/repos","events_url":"https://api.github.com/users/AnnaCW/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaCW/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnnaCW/rails_engine","description":null,"fork":false,"url":"https://api.github.com/repos/AnnaCW/rails_engine","forks_url":"https://api.github.com/repos/AnnaCW/rails_engine/forks","keys_url":"https://api.github.com/repos/AnnaCW/rails_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnnaCW/rails_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnnaCW/rails_engine/teams","hooks_url":"https://api.github.com/repos/AnnaCW/rails_engine/hooks","issue_events_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/events{/number}","events_url":"https://api.github.com/repos/AnnaCW/rails_engine/events","assignees_url":"https://api.github.com/repos/AnnaCW/rails_engine/assignees{/user}","branches_url":"https://api.github.com/repos/AnnaCW/rails_engine/branches{/branch}","tags_url":"https://api.github.com/repos/AnnaCW/rails_engine/tags","blobs_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnnaCW/rails_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/AnnaCW/rails_engine/languages","stargazers_url":"https://api.github.com/repos/AnnaCW/rails_engine/stargazers","contributors_url":"https://api.github.com/repos/AnnaCW/rails_engine/contributors","subscribers_url":"https://api.github.com/repos/AnnaCW/rails_engine/subscribers","subscription_url":"https://api.github.com/repos/AnnaCW/rails_engine/subscription","commits_url":"https://api.github.com/repos/AnnaCW/rails_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnnaCW/rails_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnnaCW/rails_engine/contents/{+path}","compare_url":"https://api.github.com/repos/AnnaCW/rails_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnnaCW/rails_engine/merges","archive_url":"https://api.github.com/repos/AnnaCW/rails_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnnaCW/rails_engine/downloads","issues_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues{/number}","pulls_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/AnnaCW/rails_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/AnnaCW/rails_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnnaCW/rails_engine/labels{/name}","releases_url":"https://api.github.com/repos/AnnaCW/rails_engine/releases{/id}","deployments_url":"https://api.github.com/repos/AnnaCW/rails_engine/deployments","created_at":"2016-07-18T19:24:16Z","updated_at":"2016-07-18T19:25:58Z","pushed_at":"2016-07-19T05:42:37Z","git_url":"git://github.com/AnnaCW/rails_engine.git","ssh_url":"git@github.com:AnnaCW/rails_engine.git","clone_url":"https://github.com/AnnaCW/rails_engine.git","svn_url":"https://github.com/AnnaCW/rails_engine","homepage":null,"size":565,"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":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"dev"}},"base":{"label":"AnnaCW:dev","ref":"dev","sha":"cef3ccfd9f15e26f8087f61b50e7f8edc645d95c","user":{"login":"AnnaCW","id":17806544,"avatar_url":"https://avatars.githubusercontent.com/u/17806544?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaCW","html_url":"https://github.com/AnnaCW","followers_url":"https://api.github.com/users/AnnaCW/followers","following_url":"https://api.github.com/users/AnnaCW/following{/other_user}","gists_url":"https://api.github.com/users/AnnaCW/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaCW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaCW/subscriptions","organizations_url":"https://api.github.com/users/AnnaCW/orgs","repos_url":"https://api.github.com/users/AnnaCW/repos","events_url":"https://api.github.com/users/AnnaCW/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaCW/received_events","type":"User","site_admin":false},"repo":{"id":63630667,"name":"rails_engine","full_name":"AnnaCW/rails_engine","owner":{"login":"AnnaCW","id":17806544,"avatar_url":"https://avatars.githubusercontent.com/u/17806544?v=3","gravatar_id":"","url":"https://api.github.com/users/AnnaCW","html_url":"https://github.com/AnnaCW","followers_url":"https://api.github.com/users/AnnaCW/followers","following_url":"https://api.github.com/users/AnnaCW/following{/other_user}","gists_url":"https://api.github.com/users/AnnaCW/gists{/gist_id}","starred_url":"https://api.github.com/users/AnnaCW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnnaCW/subscriptions","organizations_url":"https://api.github.com/users/AnnaCW/orgs","repos_url":"https://api.github.com/users/AnnaCW/repos","events_url":"https://api.github.com/users/AnnaCW/events{/privacy}","received_events_url":"https://api.github.com/users/AnnaCW/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnnaCW/rails_engine","description":null,"fork":false,"url":"https://api.github.com/repos/AnnaCW/rails_engine","forks_url":"https://api.github.com/repos/AnnaCW/rails_engine/forks","keys_url":"https://api.github.com/repos/AnnaCW/rails_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnnaCW/rails_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnnaCW/rails_engine/teams","hooks_url":"https://api.github.com/repos/AnnaCW/rails_engine/hooks","issue_events_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/events{/number}","events_url":"https://api.github.com/repos/AnnaCW/rails_engine/events","assignees_url":"https://api.github.com/repos/AnnaCW/rails_engine/assignees{/user}","branches_url":"https://api.github.com/repos/AnnaCW/rails_engine/branches{/branch}","tags_url":"https://api.github.com/repos/AnnaCW/rails_engine/tags","blobs_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnnaCW/rails_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/AnnaCW/rails_engine/languages","stargazers_url":"https://api.github.com/repos/AnnaCW/rails_engine/stargazers","contributors_url":"https://api.github.com/repos/AnnaCW/rails_engine/contributors","subscribers_url":"https://api.github.com/repos/AnnaCW/rails_engine/subscribers","subscription_url":"https://api.github.com/repos/AnnaCW/rails_engine/subscription","commits_url":"https://api.github.com/repos/AnnaCW/rails_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnnaCW/rails_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnnaCW/rails_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnnaCW/rails_engine/contents/{+path}","compare_url":"https://api.github.com/repos/AnnaCW/rails_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnnaCW/rails_engine/merges","archive_url":"https://api.github.com/repos/AnnaCW/rails_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnnaCW/rails_engine/downloads","issues_url":"https://api.github.com/repos/AnnaCW/rails_engine/issues{/number}","pulls_url":"https://api.github.com/repos/AnnaCW/rails_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/AnnaCW/rails_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/AnnaCW/rails_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnnaCW/rails_engine/labels{/name}","releases_url":"https://api.github.com/repos/AnnaCW/rails_engine/releases{/id}","deployments_url":"https://api.github.com/repos/AnnaCW/rails_engine/deployments","created_at":"2016-07-18T19:24:16Z","updated_at":"2016-07-18T19:25:58Z","pushed_at":"2016-07-19T05:42:37Z","git_url":"git://github.com/AnnaCW/rails_engine.git","ssh_url":"git@github.com:AnnaCW/rails_engine.git","clone_url":"https://github.com/AnnaCW/rails_engine.git","svn_url":"https://github.com/AnnaCW/rails_engine","homepage":null,"size":565,"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":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21"},"html":{"href":"https://github.com/AnnaCW/rails_engine/pull/21"},"issue":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/issues/21"},"comments":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/AnnaCW/rails_engine/statuses/53a4c384ec5f41f49dd69a13e0c6c41082e42883"}}}}
{"actor":{"display_login":"AnnaCW"}}