]> source.dussan.org Git - sonarqube.git/commitdiff
[SONAR-2327] Rename methods to stick to Ruby conventions
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 11 Apr 2011 09:41:18 +0000 (11:41 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 20 Apr 2011 06:49:58 +0000 (08:49 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb

index 667861fc4555ad132c7829e0b8e43d147f437d4b..ee1e96027005d831f159c02ca882d0e0cf1bbae8 100644 (file)
@@ -29,12 +29,12 @@ class ReviewsController < ApplicationController
     \r
     @reviews = []\r
     unless params.blank?\r
-      findReviewsForUserQuery\r
+      find_reviews_for_user_query\r
     end\r
   end\r
   \r
   def list\r
-    reviews = findReviewsForRuleFailure params[:rule_failure_id]\r
+    reviews = find_reviews_for_rule_failure params[:rule_failure_id]\r
     render :partial => "list", :locals => { :reviews => reviews }\r
   end\r
   \r
@@ -58,7 +58,7 @@ class ReviewsController < ApplicationController
   end\r
   \r
   def create\r
-    unless hasRightsToCreate? params[:review][:rule_failure_id]\r
+    unless has_rights_to_create? params[:review][:rule_failure_id]\r
       render :text => "<b>Cannot create the review</b> : access denied."\r
       return\r
     end\r
@@ -72,13 +72,13 @@ class ReviewsController < ApplicationController
     @review.review_comments << @review_comment\r
     if @review.valid?\r
       @review.save\r
-      @reviews = findReviewsForRuleFailure @review.rule_failure_id\r
+      @reviews = find_reviews_for_rule_failure @review.rule_failure_id\r
     end\r
     render "create_result"\r
   end\r
   \r
   def create_comment\r
-    unless hasRightsToCreate? params[:rule_failure_id]\r
+    unless has_rights_to_create? params[:rule_failure_id]\r
       render :text => "<b>Cannot create the comment</b> : access denied."\r
       return\r
     end\r
@@ -88,7 +88,7 @@ class ReviewsController < ApplicationController
       @rule_failure_id = params[:rule_failure_id]\r
       if @review_comment.valid?\r
       @review_comment.save\r
-      @reviews = findReviewsForRuleFailure @rule_failure_id\r
+      @reviews = find_reviews_for_rule_failure @rule_failure_id\r
     end\r
       render "create_comment_result"\r
   end\r
@@ -120,7 +120,7 @@ class ReviewsController < ApplicationController
     array\r
   end\r
   \r
-  def findReviewsForUserQuery\r
+  def find_reviews_for_user_query\r
     @conditions=""\r
     @values=[]\r
     @need_and = false;\r
@@ -149,11 +149,11 @@ class ReviewsController < ApplicationController
     end\r
   end\r
   \r
-  def findReviewsForRuleFailure ( rule_failure_id )\r
+  def find_reviews_for_rule_failure ( rule_failure_id )\r
     return Review.find :all, :conditions => ['rule_failure_id=?', rule_failure_id]\r
   end\r
   \r
-  def hasRightsToCreate? ( rule_failure_id )\r
+  def has_rights_to_create? ( rule_failure_id )\r
     return false unless current_user\r
     \r
     project = RuleFailure.find( rule_failure_id, :include => ['snapshot'] ).snapshot.root_project\r