]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/issue_comment.rb
Ensure that issue comments have associated issues and users.
[rails.git] / app / models / issue_comment.rb
index 455fb040bc73c7c102de27697fac01cb119b6a3b..bbc6261640ab48d635d9256a87d754b24e0c31ed 100644 (file)
@@ -1,6 +1,8 @@
 class IssueComment < ActiveRecord::Base
-       belongs_to :issue
-       belongs_to :user
+  belongs_to :issue
+  belongs_to :user, :class_name => "User", :foreign_key => :commenter_user_id
 
-       validates :body, :presence => true
+  validates :body, :presence => true
+  validates :user, :presence => true
+  validates :issue, :presence => true
 end