{"action":"created","issue":{"url":"https://api.github.com/repos/merit-gem/merit/issues/242","labels_url":"https://api.github.com/repos/merit-gem/merit/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/merit-gem/merit/issues/242/comments","events_url":"https://api.github.com/repos/merit-gem/merit/issues/242/events","html_url":"https://github.com/merit-gem/merit/issues/242","id":115176661,"number":242,"title":"Multi company scores","user":{"login":"rept","id":1388221,"avatar_url":"https://avatars.githubusercontent.com/u/1388221?v=3","gravatar_id":"","url":"https://api.github.com/users/rept","html_url":"https://github.com/rept","followers_url":"https://api.github.com/users/rept/followers","following_url":"https://api.github.com/users/rept/following{/other_user}","gists_url":"https://api.github.com/users/rept/gists{/gist_id}","starred_url":"https://api.github.com/users/rept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rept/subscriptions","organizations_url":"https://api.github.com/users/rept/orgs","repos_url":"https://api.github.com/users/rept/repos","events_url":"https://api.github.com/users/rept/events{/privacy}","received_events_url":"https://api.github.com/users/rept/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/merit-gem/merit/labels/question/discussion","name":"question/discussion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-04T23:49:59Z","updated_at":"2015-11-05T23:38:02Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to get the following to work and wonder what the best practise would be.\r\n\r\nIn my application Users belong to a company and there are many companies in the system.\r\n\r\nI would like to create score boards per company. I would also like to get a score board per week.\r\n\r\nScores don’t seem to have custom_fields like Badges do.  So to be able to get all scores for a certain week/company I would have to iterate over the users of that company and get those scores into an array together with the user id.  Is there an easier way to do this?\r\n\r\nI was thinking maybe adding the company_id to the category of the score.  This could also be done for weeks.  That way I could do \r\n\r\n    Merit::Score.where(:category => 'scores_' + company_id + '_' + week)\r\n\r\nTo get the scores of a company and for a certain week.  Not sure if this is the correct way to go though."},"comment":{"url":"https://api.github.com/repos/merit-gem/merit/issues/comments/154232584","html_url":"https://github.com/merit-gem/merit/issues/242#issuecomment-154232584","issue_url":"https://api.github.com/repos/merit-gem/merit/issues/242","id":154232584,"user":{"login":"tute","id":54260,"avatar_url":"https://avatars.githubusercontent.com/u/54260?v=3","gravatar_id":"","url":"https://api.github.com/users/tute","html_url":"https://github.com/tute","followers_url":"https://api.github.com/users/tute/followers","following_url":"https://api.github.com/users/tute/following{/other_user}","gists_url":"https://api.github.com/users/tute/gists{/gist_id}","starred_url":"https://api.github.com/users/tute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tute/subscriptions","organizations_url":"https://api.github.com/users/tute/orgs","repos_url":"https://api.github.com/users/tute/repos","events_url":"https://api.github.com/users/tute/events{/privacy}","received_events_url":"https://api.github.com/users/tute/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T23:38:02Z","updated_at":"2015-11-05T23:38:02Z","body":"This looks good. Do you still have a standing problem that you need to solve, or this covers your needs?"}}