aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb
index ca7c805a4f7..94791b88abf 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_note.rb
@@ -23,7 +23,6 @@ class RuleNote < ActiveRecord::Base
validates_presence_of :rule, :message => "can't be empty"
validates_presence_of :user_login, :message => "can't be empty"
- validates_length_of :data, :minimum => 1
def user
@user ||=
@@ -31,5 +30,13 @@ class RuleNote < ActiveRecord::Base
user_login ? User.find(:first, :conditions => ['login=?', user_login]) : nil
end
end
+
+ def html_text
+ Api::Utils.markdown_to_html(text)
+ end
+
+ def plain_text
+ Api::Utils.convert_string_to_unix_newlines(text)
+ end
end