{"action":"created","comment":{"url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments/213230014","pull_request_review_id":150021312,"id":213230014,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzIzMDAxNA==","diff_hunk":"@@ -0,0 +1,48 @@\n+module Actions\n+  module StatCreatedPlan\n+    class Generate\n+      class << self\n+        def full(org)\n+          OrgDateRangeable.split_months_from_creation(org) do |start_date, end_date|\n+            create_count_for_date(start_date: start_date, end_date: end_date, org: org)  \n+          end\n+        end\n+\n+        def last_month(org)\n+          months = OrgDateRangeable.split_months_from_creation(org)\n+          last = months.last\n+          if last.present?\n+            create_count_for_date(start_date: last[:start_date], end_date: last[:end_date], org: org)\n+          end\n+        end\n+        \n+        def full_all_orgs\n+          Org.all.each do |org|\n+            full(org)\n+          end\n+        end\n+\n+        def last_month_all_orgs\n+          Org.all.each do |org|\n+            last_month(org)\n+          end\n+        end\n+\n+        private\n+\n+        def count_plans(start_date: , end_date: , org:)\n+          users = User.where('users.org_id = ?', org.id)\n+          plans = Plan.where('plans.created_at >= ? AND plans.created_at <= ?', start_date, end_date)\n+          owner_coowner = Role.where(access: Role.access_values_for(:creator).concat(Role.access_values_for(:administrator)).uniq)","path":"app/actions/stat_created_plan/generate.rb","position":36,"original_position":36,"commit_id":"77aa33f4660161a1ea0b4260cbdfcd2a6a4befc8","original_commit_id":"02baf22c774199cc47f01bc8c0de4339ce57c95a","user":{"login":"xsrust","id":7352616,"node_id":"MDQ6VXNlcjczNTI2MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7352616?v=4","gravatar_id":"","url":"https://api.github.com/users/xsrust","html_url":"https://github.com/xsrust","followers_url":"https://api.github.com/users/xsrust/followers","following_url":"https://api.github.com/users/xsrust/following{/other_user}","gists_url":"https://api.github.com/users/xsrust/gists{/gist_id}","starred_url":"https://api.github.com/users/xsrust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xsrust/subscriptions","organizations_url":"https://api.github.com/users/xsrust/orgs","repos_url":"https://api.github.com/users/xsrust/repos","events_url":"https://api.github.com/users/xsrust/events{/privacy}","received_events_url":"https://api.github.com/users/xsrust/received_events","type":"User","site_admin":false},"body":"@jollopre We had originally thought Master made more sense as it's more stable, but with Development diverging so far from it this sprint, it may make sense to rebase off development.\r\n\r\nThere's been work done to clean up the models so you'd be using the re-factored functions.\r\nThe downside is that there's still quite a few bugs on the dev branch at the moment, but we should be clearing those out soon, and as this feature is new, it shouldnt conflict with anything else.\r\n\r\nRebasing would also mean that Travis runs the up to date CI against the PRs.\r\n","created_at":"2018-08-28T08:46:27Z","updated_at":"2018-08-28T08:46:27Z","html_url":"https://github.com/DMPRoadmap/roadmap/pull/1824#discussion_r213230014","pull_request_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments/213230014"},"html":{"href":"https://github.com/DMPRoadmap/roadmap/pull/1824#discussion_r213230014"},"pull_request":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824"}},"in_reply_to_id":211661330},"pull_request":{"url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824","id":209355982,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzU1OTgy","html_url":"https://github.com/DMPRoadmap/roadmap/pull/1824","diff_url":"https://github.com/DMPRoadmap/roadmap/pull/1824.diff","patch_url":"https://github.com/DMPRoadmap/roadmap/pull/1824.patch","issue_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1824","number":1824,"state":"open","locked":false,"title":"Issue 1173","user":{"login":"jollopre","id":7393044,"node_id":"MDQ6VXNlcjczOTMwNDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/7393044?v=4","gravatar_id":"","url":"https://api.github.com/users/jollopre","html_url":"https://github.com/jollopre","followers_url":"https://api.github.com/users/jollopre/followers","following_url":"https://api.github.com/users/jollopre/following{/other_user}","gists_url":"https://api.github.com/users/jollopre/gists{/gist_id}","starred_url":"https://api.github.com/users/jollopre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jollopre/subscriptions","organizations_url":"https://api.github.com/users/jollopre/orgs","repos_url":"https://api.github.com/users/jollopre/repos","events_url":"https://api.github.com/users/jollopre/events{/privacy}","received_events_url":"https://api.github.com/users/jollopre/received_events","type":"User","site_admin":false},"body":"- History tables that are updated through rake tasks:\r\n  - initially (e.g. stat:joined_user:generate:full_all_orgs)\r\n  - monthly (e.g. stat:joined_user:generate:last_month_all_orgs)\r\n- Models capturing monthly aggregates for created plans and joined\r\nusers:\r\n  - Use of Single Table Inheritance from rails through Stat model\r\n  - class method for generating CSV data according to a set of instances\r\n  (e.g. StatCreatedPlan or StatJoinedUser)\r\n  - class method to retrieve data for a monthly range through\r\n  StatCreatedPlan.monthly_range or StatJoinedUser.monthly_range\r\n- Introduction of actions to avoid polluting models\r\n- Unit test for each newly model created\r\n","created_at":"2018-08-19T11:42:08Z","updated_at":"2018-08-28T08:46:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7668ae92310d3d5578f532c28ebf9dd9262f791","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824/commits","review_comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824/comments","review_comment_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1824/comments","statuses_url":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/77aa33f4660161a1ea0b4260cbdfcd2a6a4befc8","head":{"label":"DigitalCurationCentre:1173","ref":"1173","sha":"77aa33f4660161a1ea0b4260cbdfcd2a6a4befc8","user":{"login":"DigitalCurationCentre","id":1659488,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTk0ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/1659488?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalCurationCentre","html_url":"https://github.com/DigitalCurationCentre","followers_url":"https://api.github.com/users/DigitalCurationCentre/followers","following_url":"https://api.github.com/users/DigitalCurationCentre/following{/other_user}","gists_url":"https://api.github.com/users/DigitalCurationCentre/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalCurationCentre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalCurationCentre/subscriptions","organizations_url":"https://api.github.com/users/DigitalCurationCentre/orgs","repos_url":"https://api.github.com/users/DigitalCurationCentre/repos","events_url":"https://api.github.com/users/DigitalCurationCentre/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalCurationCentre/received_events","type":"Organization","site_admin":false},"repo":{"id":61218142,"node_id":"MDEwOlJlcG9zaXRvcnk2MTIxODE0Mg==","name":"roadmap","full_name":"DigitalCurationCentre/roadmap","owner":{"login":"DigitalCurationCentre","id":1659488,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTk0ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/1659488?v=4","gravatar_id":"","url":"https://api.github.com/users/DigitalCurationCentre","html_url":"https://github.com/DigitalCurationCentre","followers_url":"https://api.github.com/users/DigitalCurationCentre/followers","following_url":"https://api.github.com/users/DigitalCurationCentre/following{/other_user}","gists_url":"https://api.github.com/users/DigitalCurationCentre/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalCurationCentre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalCurationCentre/subscriptions","organizations_url":"https://api.github.com/users/DigitalCurationCentre/orgs","repos_url":"https://api.github.com/users/DigitalCurationCentre/repos","events_url":"https://api.github.com/users/DigitalCurationCentre/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalCurationCentre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DigitalCurationCentre/roadmap","description":"DCC/UC3 collaboration for a data management planning tool ","fork":true,"url":"https://api.github.com/repos/DigitalCurationCentre/roadmap","forks_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/forks","keys_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/teams","hooks_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/hooks","issue_events_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/issues/events{/number}","events_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/events","assignees_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/assignees{/user}","branches_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/branches{/branch}","tags_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/tags","blobs_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/statuses/{sha}","languages_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/languages","stargazers_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/stargazers","contributors_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/contributors","subscribers_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/subscribers","subscription_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/subscription","commits_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/contents/{+path}","compare_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/merges","archive_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/downloads","issues_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/issues{/number}","pulls_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/pulls{/number}","milestones_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/milestones{/number}","notifications_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/labels{/name}","releases_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/releases{/id}","deployments_url":"https://api.github.com/repos/DigitalCurationCentre/roadmap/deployments","created_at":"2016-06-15T15:16:39Z","updated_at":"2018-08-16T19:57:10Z","pushed_at":"2018-08-25T00:43:38Z","git_url":"git://github.com/DigitalCurationCentre/roadmap.git","ssh_url":"git@github.com:DigitalCurationCentre/roadmap.git","clone_url":"https://github.com/DigitalCurationCentre/roadmap.git","svn_url":"https://github.com/DigitalCurationCentre/roadmap","homepage":null,"size":68214,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"DMPRoadmap:master","ref":"master","sha":"c1cc022ae185651973b979f0d2a5a382e9cc4a62","user":{"login":"DMPRoadmap","id":19314450,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MzE0NDUw","avatar_url":"https://avatars0.githubusercontent.com/u/19314450?v=4","gravatar_id":"","url":"https://api.github.com/users/DMPRoadmap","html_url":"https://github.com/DMPRoadmap","followers_url":"https://api.github.com/users/DMPRoadmap/followers","following_url":"https://api.github.com/users/DMPRoadmap/following{/other_user}","gists_url":"https://api.github.com/users/DMPRoadmap/gists{/gist_id}","starred_url":"https://api.github.com/users/DMPRoadmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DMPRoadmap/subscriptions","organizations_url":"https://api.github.com/users/DMPRoadmap/orgs","repos_url":"https://api.github.com/users/DMPRoadmap/repos","events_url":"https://api.github.com/users/DMPRoadmap/events{/privacy}","received_events_url":"https://api.github.com/users/DMPRoadmap/received_events","type":"Organization","site_admin":false},"repo":{"id":58585337,"node_id":"MDEwOlJlcG9zaXRvcnk1ODU4NTMzNw==","name":"roadmap","full_name":"DMPRoadmap/roadmap","owner":{"login":"DMPRoadmap","id":19314450,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MzE0NDUw","avatar_url":"https://avatars0.githubusercontent.com/u/19314450?v=4","gravatar_id":"","url":"https://api.github.com/users/DMPRoadmap","html_url":"https://github.com/DMPRoadmap","followers_url":"https://api.github.com/users/DMPRoadmap/followers","following_url":"https://api.github.com/users/DMPRoadmap/following{/other_user}","gists_url":"https://api.github.com/users/DMPRoadmap/gists{/gist_id}","starred_url":"https://api.github.com/users/DMPRoadmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DMPRoadmap/subscriptions","organizations_url":"https://api.github.com/users/DMPRoadmap/orgs","repos_url":"https://api.github.com/users/DMPRoadmap/repos","events_url":"https://api.github.com/users/DMPRoadmap/events{/privacy}","received_events_url":"https://api.github.com/users/DMPRoadmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DMPRoadmap/roadmap","description":"DCC/UC3 collaboration for a data management planning tool ","fork":false,"url":"https://api.github.com/repos/DMPRoadmap/roadmap","forks_url":"https://api.github.com/repos/DMPRoadmap/roadmap/forks","keys_url":"https://api.github.com/repos/DMPRoadmap/roadmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DMPRoadmap/roadmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DMPRoadmap/roadmap/teams","hooks_url":"https://api.github.com/repos/DMPRoadmap/roadmap/hooks","issue_events_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/events{/number}","events_url":"https://api.github.com/repos/DMPRoadmap/roadmap/events","assignees_url":"https://api.github.com/repos/DMPRoadmap/roadmap/assignees{/user}","branches_url":"https://api.github.com/repos/DMPRoadmap/roadmap/branches{/branch}","tags_url":"https://api.github.com/repos/DMPRoadmap/roadmap/tags","blobs_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/{sha}","languages_url":"https://api.github.com/repos/DMPRoadmap/roadmap/languages","stargazers_url":"https://api.github.com/repos/DMPRoadmap/roadmap/stargazers","contributors_url":"https://api.github.com/repos/DMPRoadmap/roadmap/contributors","subscribers_url":"https://api.github.com/repos/DMPRoadmap/roadmap/subscribers","subscription_url":"https://api.github.com/repos/DMPRoadmap/roadmap/subscription","commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/DMPRoadmap/roadmap/contents/{+path}","compare_url":"https://api.github.com/repos/DMPRoadmap/roadmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DMPRoadmap/roadmap/merges","archive_url":"https://api.github.com/repos/DMPRoadmap/roadmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DMPRoadmap/roadmap/downloads","issues_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues{/number}","pulls_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls{/number}","milestones_url":"https://api.github.com/repos/DMPRoadmap/roadmap/milestones{/number}","notifications_url":"https://api.github.com/repos/DMPRoadmap/roadmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DMPRoadmap/roadmap/labels{/name}","releases_url":"https://api.github.com/repos/DMPRoadmap/roadmap/releases{/id}","deployments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/deployments","created_at":"2016-05-11T22:01:32Z","updated_at":"2018-08-07T17:18:13Z","pushed_at":"2018-08-27T18:36:58Z","git_url":"git://github.com/DMPRoadmap/roadmap.git","ssh_url":"git@github.com:DMPRoadmap/roadmap.git","clone_url":"https://github.com/DMPRoadmap/roadmap.git","svn_url":"https://github.com/DMPRoadmap/roadmap","homepage":null,"size":66527,"stargazers_count":33,"watchers_count":33,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":29,"open_issues":116,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824"},"html":{"href":"https://github.com/DMPRoadmap/roadmap/pull/1824"},"issue":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1824"},"comments":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1824/comments"},"review_comments":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824/comments"},"review_comment":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1824/commits"},"statuses":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/77aa33f4660161a1ea0b4260cbdfcd2a6a4befc8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"xsrust"}}