Added support for reporting Changesets + Deleting issues from the CLI

This commit is contained in:
Shrey 2015-06-19 23:26:45 +05:30 committed by Matt Amos
parent cf639202b8
commit b68b29b43c
9 changed files with 51 additions and 16 deletions

View file

@ -2,8 +2,8 @@ class Issue < ActiveRecord::Base
belongs_to :reportable, :polymorphic => true
belongs_to :user, :class_name => "User", :foreign_key => :reported_user_id
has_many :reports
has_many :comments, :class_name => "IssueComment"
has_many :reports, dependent: :destroy
has_many :comments, :class_name => "IssueComment", dependent: :destroy
validates :reportable_id, :uniqueness => { :scope => [ :reportable_type ] }
validates :reported_user_id, :presence => true