\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
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
@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
@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
array\r
end\r
\r
- def findReviewsForUserQuery\r
+ def find_reviews_for_user_query\r
@conditions=""\r
@values=[]\r
@need_and = false;\r
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