aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-03-21 11:04:25 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-03-21 11:05:58 +0100
commitfa08e040520ca8865b447a8f7866b602c44d1d62 (patch)
treef4edd4fc509f813f52c6038a060afda211d1da0b /sonar-server/src/main/webapp/WEB-INF
parent5d24e25526515173803017cb7a0844f4e26a4b75 (diff)
downloadsonarqube-fa08e040520ca8865b447a8f7866b602c44d1d62.tar.gz
sonarqube-fa08e040520ca8865b447a8f7866b602c44d1d62.zip
Replace deprecated find(:first, ...) by first(...) call
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/metrics_controller.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/metrics_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/metrics_controller.rb
index 6d1f889e2ed..00d4e7c04a7 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/metrics_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/metrics_controller.rb
@@ -44,7 +44,7 @@ class Api::MetricsController < Api::RestController
end
def create
- metric_test = Metric.find(:first, :conditions => ['name=? OR id=?', params[:id], params[:id].to_i])
+ metric_test = Metric.first(:conditions => ['name=? OR id=?', params[:id], params[:id].to_i])
exist_and_is_disable = !metric_test.nil? && !metric_test.enabled?
if exist_and_is_disable
@@ -65,7 +65,7 @@ class Api::MetricsController < Api::RestController
end
def update
- metric = Metric.find(:first, :conditions => ['(name=? OR id=?) AND enabled=? AND origin<>?', params[:id], params[:id].to_i, true, Metric::ORIGIN_JAVA])
+ metric = Metric.first(:conditions => ['(name=? OR id=?) AND enabled=? AND origin<>?', params[:id], params[:id].to_i, true, Metric::ORIGIN_JAVA])
if metric
begin
metric.attributes = params.merge({:name => params[:id], :short_name => params[:name], :enabled => true})
@@ -81,7 +81,7 @@ class Api::MetricsController < Api::RestController
end
def destroy
- metric = Metric.find(:first, :conditions => ['(name=? OR id=?) AND enabled=? AND origin<>?', params[:id], params[:id].to_i, true, Metric::ORIGIN_JAVA])
+ metric = Metric.first(:conditions => ['(name=? OR id=?) AND enabled=? AND origin<>?', params[:id], params[:id].to_i, true, Metric::ORIGIN_JAVA])
if !metric
rest_status_ko('Unable to delete : Metric [' + params[:id] + '] does not exist', 404)
else
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
index d6942b6c6ca..640ddec3870 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb
@@ -42,7 +42,7 @@ class MetricsController < ApplicationController
if params[:id]
metric = Metric.find(params[:id].to_i)
else
- metric = Metric.find(:first, :conditions => ["name = ?", metric_name])
+ metric = Metric.first(:conditions => ["name = ?", metric_name])
if metric
@reactivate_metric = metric
else