]> source.dussan.org Git - sonarqube.git/commitdiff
The field "period_index" of the ruby component Api::DashboardConfiguration should...
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 2 Dec 2011 09:03:26 +0000 (10:03 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 2 Dec 2011 09:03:26 +0000 (10:03 +0100)
sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb

index fbb510964c331eb3d973d7d18c969aa6a8e7c38e..3ae393f9d9ef5adf5d8f8b952026796f10a1094b 100644 (file)
@@ -23,9 +23,8 @@ class Api::DashboardConfiguration
 
   def initialize(dashboard, options={})
     @dashboard=dashboard
-    @period_index=(options[:period_index].present? ? options[:period_index].to_i : nil)
-
-    @selected_period=(@period_index && @period_index>0)
+    @period_index=options[:period_index].to_i
+    @selected_period=(@period_index>0)
     @snapshot=options[:snapshot]
   end