]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/issue.rb
Added IssueComments + ForeignKeys + Indexes
[rails.git] / app / models / issue.rb
index 277ea3569ca94fe003cfa456b6372ce498519648..7a481fe6cc80e0594f51a7ff167075a0a983d22b 100644 (file)
@@ -1,8 +1,10 @@
 class Issue < ActiveRecord::Base
        belongs_to :reportable, :polymorphic => true
        has_many :reports
+       has_many :comments, :class_name => "IssueComment"
        validates :reportable_id, :uniqueness => { :scope => [ :reportable_type ] }
        belongs_to :user
+       validates :user_id, :presence => true
 
        # Check if more statuses are needed
        enum status: %w( open ignored resolved )