{"action":"created","comment":{"url":"https://api.github.com/repos/xbell/walrus/pulls/comments/45802438","id":45802438,"diff_hunk":"@@ -0,0 +1,100 @@\n+<% require 'time' %>\n+\n+<div class = \"menubody\">\n+\n+    <h1>Food Menu for <%=Time.now.strftime(\"%A, %b %d\")%></h1>\n+    <div class = \"center\">\n+\n+      <h3 class = \"toggle\">~ CLICK TO HIDE MENU ITEMS ~</h3>\n+      <h3 class = \"toggle\", style =\"display: none\">~ CLICK TO SHOW MENU ITEMS ~</h3>\n+\n+      <ul>\n+        <% @sections.each do |section| %>\n+        <li>\n+          <a><h2><%= link_to section.name, section %></h2></a>\n+        </li>\n+          <%=section.description %>\n+\n+\n+          <div class = \"hide\">\n+           <ul>\n+            <% @items.each do |item| %>\n+              <% if item.menu_section_id == section.id %>","path":"app/views/sections/index.html.erb","position":22,"original_position":22,"commit_id":"fa52fec6930478dd0c828273e1abe84fc32f65e9","original_commit_id":"fa52fec6930478dd0c828273e1abe84fc32f65e9","user":{"login":"bookis","id":134635,"avatar_url":"https://avatars.githubusercontent.com/u/134635?v=3","gravatar_id":"","url":"https://api.github.com/users/bookis","html_url":"https://github.com/bookis","followers_url":"https://api.github.com/users/bookis/followers","following_url":"https://api.github.com/users/bookis/following{/other_user}","gists_url":"https://api.github.com/users/bookis/gists{/gist_id}","starred_url":"https://api.github.com/users/bookis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bookis/subscriptions","organizations_url":"https://api.github.com/users/bookis/orgs","repos_url":"https://api.github.com/users/bookis/repos","events_url":"https://api.github.com/users/bookis/events{/privacy}","received_events_url":"https://api.github.com/users/bookis/received_events","type":"User","site_admin":false},"body":"This is a very logical way to do this, but if you use the association methods then you don't need to do the comparison of ids here. By putting `has_many :items` in the MenuSection class, it will allow you to use `.items` on a particular section to return an array of items with a matching menu_section_id\r\n\r\n```html\r\n<% section.items.each do |item|\r\n  <li>\r\n    <span class='item'><%= item.name %>...</span>\r\n  </li>\r\n<% end %>\r\n```","created_at":"2015-11-24T22:11:19Z","updated_at":"2015-11-24T22:11:19Z","html_url":"https://github.com/xbell/walrus/pull/4#discussion_r45802438","pull_request_url":"https://api.github.com/repos/xbell/walrus/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/xbell/walrus/pulls/comments/45802438"},"html":{"href":"https://github.com/xbell/walrus/pull/4#discussion_r45802438"},"pull_request":{"href":"https://api.github.com/repos/xbell/walrus/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/xbell/walrus/pulls/4","id":51723851,"html_url":"https://github.com/xbell/walrus/pull/4","diff_url":"https://github.com/xbell/walrus/pull/4.diff","patch_url":"https://github.com/xbell/walrus/pull/4.patch","issue_url":"https://api.github.com/repos/xbell/walrus/issues/4","number":4,"state":"open","locked":false,"title":"Evelyn Review","user":{"login":"bookis","id":134635,"avatar_url":"https://avatars.githubusercontent.com/u/134635?v=3","gravatar_id":"","url":"https://api.github.com/users/bookis","html_url":"https://github.com/bookis","followers_url":"https://api.github.com/users/bookis/followers","following_url":"https://api.github.com/users/bookis/following{/other_user}","gists_url":"https://api.github.com/users/bookis/gists{/gist_id}","starred_url":"https://api.github.com/users/bookis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bookis/subscriptions","organizations_url":"https://api.github.com/users/bookis/orgs","repos_url":"https://api.github.com/users/bookis/repos","events_url":"https://api.github.com/users/bookis/events{/privacy}","received_events_url":"https://api.github.com/users/bookis/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-24T22:04:23Z","updated_at":"2015-11-24T22:11:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b53b0b0ba6d31c73937733da1dc5a6ab053ebd9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xbell/walrus/pulls/4/commits","review_comments_url":"https://api.github.com/repos/xbell/walrus/pulls/4/comments","review_comment_url":"https://api.github.com/repos/xbell/walrus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xbell/walrus/issues/4/comments","statuses_url":"https://api.github.com/repos/xbell/walrus/statuses/fa52fec6930478dd0c828273e1abe84fc32f65e9","head":{"label":"xbell:evelyn","ref":"evelyn","sha":"fa52fec6930478dd0c828273e1abe84fc32f65e9","user":{"login":"xbell","id":15000565,"avatar_url":"https://avatars.githubusercontent.com/u/15000565?v=3","gravatar_id":"","url":"https://api.github.com/users/xbell","html_url":"https://github.com/xbell","followers_url":"https://api.github.com/users/xbell/followers","following_url":"https://api.github.com/users/xbell/following{/other_user}","gists_url":"https://api.github.com/users/xbell/gists{/gist_id}","starred_url":"https://api.github.com/users/xbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbell/subscriptions","organizations_url":"https://api.github.com/users/xbell/orgs","repos_url":"https://api.github.com/users/xbell/repos","events_url":"https://api.github.com/users/xbell/events{/privacy}","received_events_url":"https://api.github.com/users/xbell/received_events","type":"User","site_admin":false},"repo":{"id":45870178,"name":"walrus","full_name":"xbell/walrus","owner":{"login":"xbell","id":15000565,"avatar_url":"https://avatars.githubusercontent.com/u/15000565?v=3","gravatar_id":"","url":"https://api.github.com/users/xbell","html_url":"https://github.com/xbell","followers_url":"https://api.github.com/users/xbell/followers","following_url":"https://api.github.com/users/xbell/following{/other_user}","gists_url":"https://api.github.com/users/xbell/gists{/gist_id}","starred_url":"https://api.github.com/users/xbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbell/subscriptions","organizations_url":"https://api.github.com/users/xbell/orgs","repos_url":"https://api.github.com/users/xbell/repos","events_url":"https://api.github.com/users/xbell/events{/privacy}","received_events_url":"https://api.github.com/users/xbell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xbell/walrus","description":"","fork":false,"url":"https://api.github.com/repos/xbell/walrus","forks_url":"https://api.github.com/repos/xbell/walrus/forks","keys_url":"https://api.github.com/repos/xbell/walrus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbell/walrus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbell/walrus/teams","hooks_url":"https://api.github.com/repos/xbell/walrus/hooks","issue_events_url":"https://api.github.com/repos/xbell/walrus/issues/events{/number}","events_url":"https://api.github.com/repos/xbell/walrus/events","assignees_url":"https://api.github.com/repos/xbell/walrus/assignees{/user}","branches_url":"https://api.github.com/repos/xbell/walrus/branches{/branch}","tags_url":"https://api.github.com/repos/xbell/walrus/tags","blobs_url":"https://api.github.com/repos/xbell/walrus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbell/walrus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbell/walrus/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbell/walrus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbell/walrus/statuses/{sha}","languages_url":"https://api.github.com/repos/xbell/walrus/languages","stargazers_url":"https://api.github.com/repos/xbell/walrus/stargazers","contributors_url":"https://api.github.com/repos/xbell/walrus/contributors","subscribers_url":"https://api.github.com/repos/xbell/walrus/subscribers","subscription_url":"https://api.github.com/repos/xbell/walrus/subscription","commits_url":"https://api.github.com/repos/xbell/walrus/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbell/walrus/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbell/walrus/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbell/walrus/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbell/walrus/contents/{+path}","compare_url":"https://api.github.com/repos/xbell/walrus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbell/walrus/merges","archive_url":"https://api.github.com/repos/xbell/walrus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbell/walrus/downloads","issues_url":"https://api.github.com/repos/xbell/walrus/issues{/number}","pulls_url":"https://api.github.com/repos/xbell/walrus/pulls{/number}","milestones_url":"https://api.github.com/repos/xbell/walrus/milestones{/number}","notifications_url":"https://api.github.com/repos/xbell/walrus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbell/walrus/labels{/name}","releases_url":"https://api.github.com/repos/xbell/walrus/releases{/id}","created_at":"2015-11-09T22:11:49Z","updated_at":"2015-11-09T22:15:36Z","pushed_at":"2015-11-24T22:04:24Z","git_url":"git://github.com/xbell/walrus.git","ssh_url":"git@github.com:xbell/walrus.git","clone_url":"https://github.com/xbell/walrus.git","svn_url":"https://github.com/xbell/walrus","homepage":null,"size":980,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"xbell:review","ref":"review","sha":"f9a4221317d7d291f93cc6047e88a722c28cf06c","user":{"login":"xbell","id":15000565,"avatar_url":"https://avatars.githubusercontent.com/u/15000565?v=3","gravatar_id":"","url":"https://api.github.com/users/xbell","html_url":"https://github.com/xbell","followers_url":"https://api.github.com/users/xbell/followers","following_url":"https://api.github.com/users/xbell/following{/other_user}","gists_url":"https://api.github.com/users/xbell/gists{/gist_id}","starred_url":"https://api.github.com/users/xbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbell/subscriptions","organizations_url":"https://api.github.com/users/xbell/orgs","repos_url":"https://api.github.com/users/xbell/repos","events_url":"https://api.github.com/users/xbell/events{/privacy}","received_events_url":"https://api.github.com/users/xbell/received_events","type":"User","site_admin":false},"repo":{"id":45870178,"name":"walrus","full_name":"xbell/walrus","owner":{"login":"xbell","id":15000565,"avatar_url":"https://avatars.githubusercontent.com/u/15000565?v=3","gravatar_id":"","url":"https://api.github.com/users/xbell","html_url":"https://github.com/xbell","followers_url":"https://api.github.com/users/xbell/followers","following_url":"https://api.github.com/users/xbell/following{/other_user}","gists_url":"https://api.github.com/users/xbell/gists{/gist_id}","starred_url":"https://api.github.com/users/xbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbell/subscriptions","organizations_url":"https://api.github.com/users/xbell/orgs","repos_url":"https://api.github.com/users/xbell/repos","events_url":"https://api.github.com/users/xbell/events{/privacy}","received_events_url":"https://api.github.com/users/xbell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xbell/walrus","description":"","fork":false,"url":"https://api.github.com/repos/xbell/walrus","forks_url":"https://api.github.com/repos/xbell/walrus/forks","keys_url":"https://api.github.com/repos/xbell/walrus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbell/walrus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbell/walrus/teams","hooks_url":"https://api.github.com/repos/xbell/walrus/hooks","issue_events_url":"https://api.github.com/repos/xbell/walrus/issues/events{/number}","events_url":"https://api.github.com/repos/xbell/walrus/events","assignees_url":"https://api.github.com/repos/xbell/walrus/assignees{/user}","branches_url":"https://api.github.com/repos/xbell/walrus/branches{/branch}","tags_url":"https://api.github.com/repos/xbell/walrus/tags","blobs_url":"https://api.github.com/repos/xbell/walrus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbell/walrus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbell/walrus/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbell/walrus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbell/walrus/statuses/{sha}","languages_url":"https://api.github.com/repos/xbell/walrus/languages","stargazers_url":"https://api.github.com/repos/xbell/walrus/stargazers","contributors_url":"https://api.github.com/repos/xbell/walrus/contributors","subscribers_url":"https://api.github.com/repos/xbell/walrus/subscribers","subscription_url":"https://api.github.com/repos/xbell/walrus/subscription","commits_url":"https://api.github.com/repos/xbell/walrus/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbell/walrus/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbell/walrus/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbell/walrus/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbell/walrus/contents/{+path}","compare_url":"https://api.github.com/repos/xbell/walrus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbell/walrus/merges","archive_url":"https://api.github.com/repos/xbell/walrus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbell/walrus/downloads","issues_url":"https://api.github.com/repos/xbell/walrus/issues{/number}","pulls_url":"https://api.github.com/repos/xbell/walrus/pulls{/number}","milestones_url":"https://api.github.com/repos/xbell/walrus/milestones{/number}","notifications_url":"https://api.github.com/repos/xbell/walrus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbell/walrus/labels{/name}","releases_url":"https://api.github.com/repos/xbell/walrus/releases{/id}","created_at":"2015-11-09T22:11:49Z","updated_at":"2015-11-09T22:15:36Z","pushed_at":"2015-11-24T22:04:24Z","git_url":"git://github.com/xbell/walrus.git","ssh_url":"git@github.com:xbell/walrus.git","clone_url":"https://github.com/xbell/walrus.git","svn_url":"https://github.com/xbell/walrus","homepage":null,"size":980,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xbell/walrus/pulls/4"},"html":{"href":"https://github.com/xbell/walrus/pull/4"},"issue":{"href":"https://api.github.com/repos/xbell/walrus/issues/4"},"comments":{"href":"https://api.github.com/repos/xbell/walrus/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/xbell/walrus/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/xbell/walrus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xbell/walrus/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/xbell/walrus/statuses/fa52fec6930478dd0c828273e1abe84fc32f65e9"}}}}