{"action":"created","issue":{"url":"https://api.github.com/repos/penzance/askup/issues/83","repository_url":"https://api.github.com/repos/penzance/askup","labels_url":"https://api.github.com/repos/penzance/askup/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/penzance/askup/issues/83/comments","events_url":"https://api.github.com/repos/penzance/askup/issues/83/events","html_url":"https://github.com/penzance/askup/pull/83","id":147513927,"number":83,"title":"Liza/display correct question counts","user":{"login":"lizamcpherson01","id":11150868,"avatar_url":"https://avatars.githubusercontent.com/u/11150868?v=3","gravatar_id":"","url":"https://api.github.com/users/lizamcpherson01","html_url":"https://github.com/lizamcpherson01","followers_url":"https://api.github.com/users/lizamcpherson01/followers","following_url":"https://api.github.com/users/lizamcpherson01/following{/other_user}","gists_url":"https://api.github.com/users/lizamcpherson01/gists{/gist_id}","starred_url":"https://api.github.com/users/lizamcpherson01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizamcpherson01/subscriptions","organizations_url":"https://api.github.com/users/lizamcpherson01/orgs","repos_url":"https://api.github.com/users/lizamcpherson01/repos","events_url":"https://api.github.com/users/lizamcpherson01/events{/privacy}","received_events_url":"https://api.github.com/users/lizamcpherson01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-11T18:32:10Z","updated_at":"2016-04-11T19:55:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/penzance/askup/pulls/83","html_url":"https://github.com/penzance/askup/pull/83","diff_url":"https://github.com/penzance/askup/pull/83.diff","patch_url":"https://github.com/penzance/askup/pull/83.patch"},"body":"This addresses two separate issues. \r\n\r\nThe first, which affects files app/assets/javascripts/qsets.js and app/views/questions/show.html.erb, makes it possible for users to now vote on the quality of a question directly after answering it, instead of restricting this functionality to the qset view. The functionality was previously tested by Katherine as part of a previous PR that was not incorporated.\r\n\r\nThe second, which affects files app/controllers/qsets_controller.rb and app/models/qset.rb, addresses a bug that prevented a particular qset's question count from being correctly updated and displayed if the type of its subsets were later altered. For instance, if a qset was of type \"questions\" and was later changed to type \"subsets,\" it now doesn't include its former questions in its new question count. See trello card: https://trello.com/c/CnSZaVAG/509-display-correct-question-counts"},"comment":{"url":"https://api.github.com/repos/penzance/askup/issues/comments/208529717","html_url":"https://github.com/penzance/askup/pull/83#issuecomment-208529717","issue_url":"https://api.github.com/repos/penzance/askup/issues/83","id":208529717,"user":{"login":"rckim77","id":2919157,"avatar_url":"https://avatars.githubusercontent.com/u/2919157?v=3","gravatar_id":"","url":"https://api.github.com/users/rckim77","html_url":"https://github.com/rckim77","followers_url":"https://api.github.com/users/rckim77/followers","following_url":"https://api.github.com/users/rckim77/following{/other_user}","gists_url":"https://api.github.com/users/rckim77/gists{/gist_id}","starred_url":"https://api.github.com/users/rckim77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rckim77/subscriptions","organizations_url":"https://api.github.com/users/rckim77/orgs","repos_url":"https://api.github.com/users/rckim77/repos","events_url":"https://api.github.com/users/rckim77/events{/privacy}","received_events_url":"https://api.github.com/users/rckim77/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T19:55:30Z","updated_at":"2016-04-11T19:55:30Z","body":"Great work! I found a few bugs.\r\n\r\n1.The question count doesn't update properly when a question is added to a qset of either type 'questions' or 'mixed' when its parent qset is of type 'subsets' and that parent's parent qset is of type 'subsets'. If the parent qset is changed to type 'mixed', then the parent's parent qset doesn't display the correct question count anymore.\r\n\r\n2. Let's say you have a qset 'Biology' of type 'subsets'. Inside Biology you have a qset 'Population Ecology' of type 'Mixed'. In this qset, you have a qset 'Population Ecology Subset 1' of type 'Mixed'. In this qset 'Population Ecology Subset 1', let's say you have one question. When you go back up to check the question counts, 'Biology', 'Population Ecology', and 'Population Ecology Subset 1' all correctly say 1. However, if you change the qset_type of 'Population Ecology' to 'questions', then if you go to check the question counts, for 'Population Ecology' it says 1–even though it should say 0 since the user can no longer see the question in subsets of 'Population Ecology' (i.e., it should say 0 since there are no questions immediately within the qset 'Population Ecology'). For 'Biology', however, it correctly displays 0. This may or may not be affected by bug 3 below.\r\n\r\n3. For some reason, there are inheritance issues where if I change the qset_type through the edit qset modal, its children also adopt this new qset_type. Hopefully this is because you haven't incorporated my updated code for how qset types are edited and initiated (it used to be inherited from parent qsets but I changed it to default to 'questions' if the user didn't choose a particular qset_type when they first created the qset). This may or may not affect your code.\r\n\r\nSee if you can recreate some of the bugs I came across and let me know if you have any questions!"}}