From c1f6bd2c61e96cff3bad2695a3fc995cfd0f9732 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 22 Jan 2014 13:56:31 +0100 Subject: [PATCH] SONAR-4923 Remove remaining usage of rule_notes and active_rule_notes --- .../main/webapp/WEB-INF/app/controllers/issue_controller.rb | 2 +- sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb | 2 +- sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb | 2 +- .../src/main/webapp/WEB-INF/app/views/issue/_rule.html.erb | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb index afd842cb875..58df6c0e39f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb @@ -186,7 +186,7 @@ class IssueController < ApplicationController verify_ajax_request require_parameters :id rule_key = params[:id].split(':') - @rule = Rule.first(:conditions => ['plugin_name=? and plugin_rule_key=?', rule_key[0], rule_key[1]], :include => :rule_note) + @rule = Rule.first(:conditions => ['plugin_name=? and plugin_rule_key=?', rule_key[0], rule_key[1]]) render :partial => 'issue/rule' end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb index 217be41cd8c..d9dfd4410fb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb @@ -22,7 +22,7 @@ class Profile < ActiveRecord::Base has_many :alerts, :dependent => :delete_all has_many :active_rules, :class_name => 'ActiveRule', :foreign_key => 'profile_id', :dependent => :destroy, :include => ['rule'] - has_many :active_rules_with_params, :class_name => 'ActiveRule', :foreign_key => 'profile_id', :include => ['active_rule_parameters', 'active_rule_note'] + has_many :active_rules_with_params, :class_name => 'ActiveRule', :foreign_key => 'profile_id', :include => ['active_rule_parameters'] has_many :changes, :class_name => 'ActiveRuleChange', :dependent => :destroy validates_uniqueness_of :name, :scope => :language, :case_sensitive => false, :message => Api::Utils.message('quality_profiles.already_exists') diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb index 4fb806c1fe4..444d6d61e54 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb @@ -272,7 +272,7 @@ class Rule < ActiveRecord::Base conditions << "id IN (:ids)" values[:ids] = Array(Internal.rules.findIds(params)) - includes=(options[:include_parameters_and_notes] ? [:rules_parameters, :rule_note] : nil) + includes=(options[:include_parameters_and_notes] ? [:rules_parameters] : nil) rules = Rule.all(:include => includes, :conditions => [conditions.join(" AND "), values]) rules = Rule.sort_by(rules, options[:sort_by]) filter(rules, options) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_rule.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_rule.html.erb index a0165ac138f..f93e91898f2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_rule.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_rule.html.erb @@ -6,9 +6,9 @@ <% end %> -<% if @rule.note %> +<% if @rule.note_data %>
- <%= @rule.note.html_text -%> + <%= Api::Utils.markdown_to_html(@rule.note_data) -%>
<% end %> @@ -16,4 +16,4 @@ <%= h @rule.plugin_name -%>  <%= image_tag 'sep12.png' -%>  <%= h @rule.plugin_rule_key -%> - \ No newline at end of file + -- 2.39.5