Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-09-08 12:33:38 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-09-08 12:33:38 +0300
commit9901c3df41d37e5d5650e28a5287a8ddf0aa754e (patch)
tree0f10ce6cfa414a45aeb3d260eb4f70b44cbe2774 /app/models/cycle_analytics.rb
parentf5b9837c19f48255237eca1e618fc632a45b58b5 (diff)
Add a JSON version of the `CycleAnalytics` page.
Diffstat (limited to 'app/models/cycle_analytics.rb')
-rw-r--r--app/models/cycle_analytics.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb
index a52b5aff559..9444f1f31a8 100644
--- a/app/models/cycle_analytics.rb
+++ b/app/models/cycle_analytics.rb
@@ -6,6 +6,13 @@ class CycleAnalytics
@from = from
end
+ def as_json(options = {})
+ {
+ issue: issue, plan: plan, code: code, test: test,
+ review: review, staging: staging, production: production
+ }
+ end
+
def issue
calculate_metric(Queries::issues(@project, created_after: @from),
-> (data_point) { data_point[:issue].created_at },