{"action":"created","issue":{"url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/5","labels_url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/5/comments","events_url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/5/events","html_url":"https://github.com/DreadPirateShawn/Dread-PAD/issues/5","id":120945596,"number":5,"title":"\"Most Awakenings\" page is broken","user":{"login":"DreadPirateShawn","id":1418951,"avatar_url":"https://avatars.githubusercontent.com/u/1418951?v=3","gravatar_id":"","url":"https://api.github.com/users/DreadPirateShawn","html_url":"https://github.com/DreadPirateShawn","followers_url":"https://api.github.com/users/DreadPirateShawn/followers","following_url":"https://api.github.com/users/DreadPirateShawn/following{/other_user}","gists_url":"https://api.github.com/users/DreadPirateShawn/gists{/gist_id}","starred_url":"https://api.github.com/users/DreadPirateShawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DreadPirateShawn/subscriptions","organizations_url":"https://api.github.com/users/DreadPirateShawn/orgs","repos_url":"https://api.github.com/users/DreadPirateShawn/repos","events_url":"https://api.github.com/users/DreadPirateShawn/events{/privacy}","received_events_url":"https://api.github.com/users/DreadPirateShawn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-08T06:48:39Z","updated_at":"2015-12-08T06:54:23Z","closed_at":null,"body":"This page won't load:\r\nhttp://www.dreadpad.com/monsters/most_awakenings\r\n\r\nLocally repro'ed, the error occurs at:\r\n**app/views/monsters/best_awoken.html.erb**\r\n```\r\nkeys = @data.keys.sort_by { |awoken| awoken.pad_id }\r\n```\r\n... citing the problem that \"nil\" doesn't have a .pad_id property.\r\n\r\nThere are only 500 \"monster awoken skill\" entries with, which is far too few... and of those, 466 were bogus. Specifically, they have monster and awoken skill values of nil. These are the proximate cause of the page error.\r\n```\r\n2.2.3 :044 > MonsterAwokenSkill.includes(:monster).includes(:awoken_skill).select{|x| x.monster.nil? || x.awoken_skill.nil?}.size\r\n  MonsterAwokenSkill Load (1.8ms)  SELECT \"monster_awoken_skills\".* FROM \"monster_awoken_skills\"\r\n  Monster Load (0.8ms)  SELECT \"monsters\".* FROM \"monsters\"  WHERE \"monsters\".\"id\" IN (3660, 3667, 3661, 3668)\r\n  AwokenSkill Load (0.7ms)  SELECT \"awoken_skills\".* FROM \"awoken_skills\"  WHERE \"awoken_skills\".\"id\" IN (31, 37, 43, 42, 47, 32, 41, 34, 35, 40)\r\n => 466\r\n```\r\n\r\nDestroying them allows the page to load successfully:\r\n```\r\nMonsterAwokenSkill.includes(:monster).includes(:awoken_skill).select{|x| x.monster.nil? || x.awoken_skill.nil?}.map(&:destroy)\r\n```\r\n\r\nHowever, it still doesn't load *properly*, and something is really buggy here."},"comment":{"url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/comments/162794144","html_url":"https://github.com/DreadPirateShawn/Dread-PAD/issues/5#issuecomment-162794144","issue_url":"https://api.github.com/repos/DreadPirateShawn/Dread-PAD/issues/5","id":162794144,"user":{"login":"DreadPirateShawn","id":1418951,"avatar_url":"https://avatars.githubusercontent.com/u/1418951?v=3","gravatar_id":"","url":"https://api.github.com/users/DreadPirateShawn","html_url":"https://github.com/DreadPirateShawn","followers_url":"https://api.github.com/users/DreadPirateShawn/followers","following_url":"https://api.github.com/users/DreadPirateShawn/following{/other_user}","gists_url":"https://api.github.com/users/DreadPirateShawn/gists{/gist_id}","starred_url":"https://api.github.com/users/DreadPirateShawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DreadPirateShawn/subscriptions","organizations_url":"https://api.github.com/users/DreadPirateShawn/orgs","repos_url":"https://api.github.com/users/DreadPirateShawn/repos","events_url":"https://api.github.com/users/DreadPirateShawn/events{/privacy}","received_events_url":"https://api.github.com/users/DreadPirateShawn/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T06:54:23Z","updated_at":"2015-12-08T06:54:23Z","body":"Is this somehow related to scraping many more entries than actually exist? namely 0 and (highest number plus next 50)? Doubtful, but the impact of semi-bogus data might be greater than I think it is, somehow..."}}