|
|
|
@@ -70,6 +70,8 @@ class Issue < ApplicationRecord |
|
|
|
has_many :issue_depends, dependent: :destroy |
|
|
|
has_many :issue_assigners |
|
|
|
has_many :assigners, through: :issue_assigners |
|
|
|
has_many :issue_participants |
|
|
|
has_many :participants, through: :issue_participants |
|
|
|
|
|
|
|
scope :issue_includes, ->{includes(:user)} |
|
|
|
scope :issue_many_includes, ->{includes(journals: :user)} |
|
|
|
@@ -77,6 +79,7 @@ class Issue < ApplicationRecord |
|
|
|
scope :issue_pull_request, ->{where(issue_classify: "pull_request")} |
|
|
|
scope :issue_index_includes, ->{includes(:tracker, :priority, :version, :issue_status, :journals,:issue_tags,user: :user_extension)} |
|
|
|
scope :closed, ->{where(status_id: 5)} |
|
|
|
scope :opened, ->{where.not(status_id: 5)} |
|
|
|
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic |
|
|
|
after_save :change_versions_count, :send_update_message_to_notice_system |
|
|
|
after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic |
|
|
|
|