]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/issue_comment.rb
Ignore the creation_ip column which is no longer used
[rails.git] / app / models / issue_comment.rb
index 2968078b3d96da719791cc220370be358aeccae3..8d150a02f8b88512fdf47070c162dfaadb2dd4e7 100644 (file)
 #
 # Foreign Keys
 #
-#  issue_comments_issue_id_fkey  (issue_id => issues.id) ON DELETE => cascade
-#  issue_comments_user_id        (user_id => users.id) ON DELETE => cascade
+#  issue_comments_issue_id_fkey  (issue_id => issues.id)
+#  issue_comments_user_id_fkey   (user_id => users.id)
 #
 
-class IssueComment < ActiveRecord::Base
+class IssueComment < ApplicationRecord
   belongs_to :issue
   belongs_to :user
 
-  validates :body, :presence => true
-  validates :user, :presence => true
-  validates :issue, :presence => true
+  validates :body, :presence => true, :characters => true
+
+  def body
+    RichText.new("markdown", self[:body])
+  end
 end