{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments/46325750","id":46325750,"diff_hunk":"@@ -3,12 +3,48 @@ def home\n \n   end\n \n+  def select\n+    redirect_to mkt_home_path(params[:market][:id])\n+  end\n+\n+  def mkt_home\n+    @market = Market.find(params[:id])","path":"app/controllers/markets_controller.rb","position":9,"original_position":9,"commit_id":"2291360755c937e3d6afcfd4dd7b6257b4fe63c4","original_commit_id":"2291360755c937e3d6afcfd4dd7b6257b4fe63c4","user":{"login":"Hamled","id":66355,"avatar_url":"https://avatars.githubusercontent.com/u/66355?v=3","gravatar_id":"","url":"https://api.github.com/users/Hamled","html_url":"https://github.com/Hamled","followers_url":"https://api.github.com/users/Hamled/followers","following_url":"https://api.github.com/users/Hamled/following{/other_user}","gists_url":"https://api.github.com/users/Hamled/gists{/gist_id}","starred_url":"https://api.github.com/users/Hamled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hamled/subscriptions","organizations_url":"https://api.github.com/users/Hamled/orgs","repos_url":"https://api.github.com/users/Hamled/repos","events_url":"https://api.github.com/users/Hamled/events{/privacy}","received_events_url":"https://api.github.com/users/Hamled/received_events","type":"User","site_admin":false},"body":"Because we're setting the `@market` variable in this same way in a few different methods, I think we could DRY this out a bit by moving that line into a `before_action`, like so:\r\n```ruby\r\nclass MarketsController < ApplicationController\r\nbefore_action :find_market, only: [:mkt_home, :show, :edit, :update]\r\n\r\n# all of your existing methods\r\n\r\nprivate\r\n\r\n  def find_market\r\n    @market = Market.find(params[:id])\r\n  end\r\nend\r\n```","created_at":"2015-12-01T19:28:39Z","updated_at":"2015-12-01T19:28:39Z","html_url":"https://github.com/Ada-C4/FarMarRails/pull/22#discussion_r46325750","pull_request_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments/46325750"},"html":{"href":"https://github.com/Ada-C4/FarMarRails/pull/22#discussion_r46325750"},"pull_request":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22","id":51695310,"html_url":"https://github.com/Ada-C4/FarMarRails/pull/22","diff_url":"https://github.com/Ada-C4/FarMarRails/pull/22.diff","patch_url":"https://github.com/Ada-C4/FarMarRails/pull/22.patch","issue_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/22","number":22,"state":"open","locked":false,"title":"Ashrlh/master","user":{"login":"annaleeherrera","id":13170169,"avatar_url":"https://avatars.githubusercontent.com/u/13170169?v=3","gravatar_id":"","url":"https://api.github.com/users/annaleeherrera","html_url":"https://github.com/annaleeherrera","followers_url":"https://api.github.com/users/annaleeherrera/followers","following_url":"https://api.github.com/users/annaleeherrera/following{/other_user}","gists_url":"https://api.github.com/users/annaleeherrera/gists{/gist_id}","starred_url":"https://api.github.com/users/annaleeherrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annaleeherrera/subscriptions","organizations_url":"https://api.github.com/users/annaleeherrera/orgs","repos_url":"https://api.github.com/users/annaleeherrera/repos","events_url":"https://api.github.com/users/annaleeherrera/events{/privacy}","received_events_url":"https://api.github.com/users/annaleeherrera/received_events","type":"User","site_admin":false},"body":"FarMarRails","created_at":"2015-11-24T18:04:53Z","updated_at":"2015-12-01T19:28:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b44da0fee8fcb8a85470ac97e7c1b16d4c689dc0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22/commits","review_comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22/comments","review_comment_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/22/comments","statuses_url":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/2291360755c937e3d6afcfd4dd7b6257b4fe63c4","head":{"label":"annaleeherrera:ashrlh/master","ref":"ashrlh/master","sha":"2291360755c937e3d6afcfd4dd7b6257b4fe63c4","user":{"login":"annaleeherrera","id":13170169,"avatar_url":"https://avatars.githubusercontent.com/u/13170169?v=3","gravatar_id":"","url":"https://api.github.com/users/annaleeherrera","html_url":"https://github.com/annaleeherrera","followers_url":"https://api.github.com/users/annaleeherrera/followers","following_url":"https://api.github.com/users/annaleeherrera/following{/other_user}","gists_url":"https://api.github.com/users/annaleeherrera/gists{/gist_id}","starred_url":"https://api.github.com/users/annaleeherrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annaleeherrera/subscriptions","organizations_url":"https://api.github.com/users/annaleeherrera/orgs","repos_url":"https://api.github.com/users/annaleeherrera/repos","events_url":"https://api.github.com/users/annaleeherrera/events{/privacy}","received_events_url":"https://api.github.com/users/annaleeherrera/received_events","type":"User","site_admin":false},"repo":{"id":46383403,"name":"FarMarRails","full_name":"annaleeherrera/FarMarRails","owner":{"login":"annaleeherrera","id":13170169,"avatar_url":"https://avatars.githubusercontent.com/u/13170169?v=3","gravatar_id":"","url":"https://api.github.com/users/annaleeherrera","html_url":"https://github.com/annaleeherrera","followers_url":"https://api.github.com/users/annaleeherrera/followers","following_url":"https://api.github.com/users/annaleeherrera/following{/other_user}","gists_url":"https://api.github.com/users/annaleeherrera/gists{/gist_id}","starred_url":"https://api.github.com/users/annaleeherrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annaleeherrera/subscriptions","organizations_url":"https://api.github.com/users/annaleeherrera/orgs","repos_url":"https://api.github.com/users/annaleeherrera/repos","events_url":"https://api.github.com/users/annaleeherrera/events{/privacy}","received_events_url":"https://api.github.com/users/annaleeherrera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annaleeherrera/FarMarRails","description":"","fork":true,"url":"https://api.github.com/repos/annaleeherrera/FarMarRails","forks_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/forks","keys_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/teams","hooks_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/hooks","issue_events_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/issues/events{/number}","events_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/events","assignees_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/assignees{/user}","branches_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/branches{/branch}","tags_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/tags","blobs_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/statuses/{sha}","languages_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/languages","stargazers_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/stargazers","contributors_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/contributors","subscribers_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/subscribers","subscription_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/subscription","commits_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/contents/{+path}","compare_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/merges","archive_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/downloads","issues_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/issues{/number}","pulls_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/pulls{/number}","milestones_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/milestones{/number}","notifications_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/labels{/name}","releases_url":"https://api.github.com/repos/annaleeherrera/FarMarRails/releases{/id}","created_at":"2015-11-17T23:59:24Z","updated_at":"2015-11-10T20:54:30Z","pushed_at":"2015-11-20T23:30:47Z","git_url":"git://github.com/annaleeherrera/FarMarRails.git","ssh_url":"git@github.com:annaleeherrera/FarMarRails.git","clone_url":"https://github.com/annaleeherrera/FarMarRails.git","svn_url":"https://github.com/annaleeherrera/FarMarRails","homepage":null,"size":1106,"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-C4:ashrlh/master","ref":"ashrlh/master","sha":"204cb6a4f3c325e63fc94867d306487ca52b66f1","user":{"login":"Ada-C4","id":14096372,"avatar_url":"https://avatars.githubusercontent.com/u/14096372?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C4","html_url":"https://github.com/Ada-C4","followers_url":"https://api.github.com/users/Ada-C4/followers","following_url":"https://api.github.com/users/Ada-C4/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C4/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C4/subscriptions","organizations_url":"https://api.github.com/users/Ada-C4/orgs","repos_url":"https://api.github.com/users/Ada-C4/repos","events_url":"https://api.github.com/users/Ada-C4/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C4/received_events","type":"Organization","site_admin":false},"repo":{"id":46368225,"name":"FarMarRails","full_name":"Ada-C4/FarMarRails","owner":{"login":"Ada-C4","id":14096372,"avatar_url":"https://avatars.githubusercontent.com/u/14096372?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C4","html_url":"https://github.com/Ada-C4","followers_url":"https://api.github.com/users/Ada-C4/followers","following_url":"https://api.github.com/users/Ada-C4/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C4/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C4/subscriptions","organizations_url":"https://api.github.com/users/Ada-C4/orgs","repos_url":"https://api.github.com/users/Ada-C4/repos","events_url":"https://api.github.com/users/Ada-C4/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C4/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C4/FarMarRails","description":"","fork":true,"url":"https://api.github.com/repos/Ada-C4/FarMarRails","forks_url":"https://api.github.com/repos/Ada-C4/FarMarRails/forks","keys_url":"https://api.github.com/repos/Ada-C4/FarMarRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C4/FarMarRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C4/FarMarRails/teams","hooks_url":"https://api.github.com/repos/Ada-C4/FarMarRails/hooks","issue_events_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C4/FarMarRails/events","assignees_url":"https://api.github.com/repos/Ada-C4/FarMarRails/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C4/FarMarRails/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C4/FarMarRails/tags","blobs_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C4/FarMarRails/languages","stargazers_url":"https://api.github.com/repos/Ada-C4/FarMarRails/stargazers","contributors_url":"https://api.github.com/repos/Ada-C4/FarMarRails/contributors","subscribers_url":"https://api.github.com/repos/Ada-C4/FarMarRails/subscribers","subscription_url":"https://api.github.com/repos/Ada-C4/FarMarRails/subscription","commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C4/FarMarRails/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C4/FarMarRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C4/FarMarRails/merges","archive_url":"https://api.github.com/repos/Ada-C4/FarMarRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C4/FarMarRails/downloads","issues_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C4/FarMarRails/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C4/FarMarRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C4/FarMarRails/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C4/FarMarRails/releases{/id}","created_at":"2015-11-17T18:54:06Z","updated_at":"2015-11-10T20:54:30Z","pushed_at":"2015-11-24T21:41:36Z","git_url":"git://github.com/Ada-C4/FarMarRails.git","ssh_url":"git@github.com:Ada-C4/FarMarRails.git","clone_url":"https://github.com/Ada-C4/FarMarRails.git","svn_url":"https://github.com/Ada-C4/FarMarRails","homepage":null,"size":835,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":11,"forks":12,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22"},"html":{"href":"https://github.com/Ada-C4/FarMarRails/pull/22"},"issue":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/22"},"comments":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/2291360755c937e3d6afcfd4dd7b6257b4fe63c4"}}}}