diff options
author | Godin <mandrikov@gmail.com> | 2010-12-13 08:37:40 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-13 08:37:40 +0000 |
commit | 3a7235c0209772229ee4bd82cb0a505729749b3a (patch) | |
tree | e9cf89546a088603a6f00f93907b4b4d0b03ef06 /sonar-server | |
parent | 30041ec9b27951cd09b7d6b64694f2d179f7ec19 (diff) | |
download | sonarqube-3a7235c0209772229ee4bd82cb0a505729749b3a.tar.gz sonarqube-3a7235c0209772229ee4bd82cb0a505729749b3a.zip |
SONAR-833: New Web Service to get history of measures (time machine)
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb index d69372155d7..92e2b51a3b2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb @@ -27,8 +27,8 @@ class Api::TimemachineController < Api::ApiController resource_id = params[:resource] metric_keys = params[:metrics].split(',') metrics = Metric.by_keys(metric_keys) - first_date = parse_datetime(params[:first_date]) - last_date = parse_datetime(params[:last_date]) + first_date = parse_datetime(params[:fromDateTime]) + last_date = parse_datetime(params[:toDateTime]) @resource=Project.by_key(resource_id) if @resource.nil? @@ -48,7 +48,7 @@ class Api::TimemachineController < Api::ApiController measures = find_measures(metrics, snapshots) - result = [] + result = {} if !measures.empty? measures_by_sid = {} measures.each do |measure| @@ -67,7 +67,7 @@ class Api::TimemachineController < Api::ApiController metric_keys.each do |metric| values<<values_by_key[metric] end - result<<{format_datetime(snapshot.created_at) => values} + result[format_datetime(snapshot.created_at)] = values end end |