修复:issue_classify 使用小写

This commit is contained in:
2023-02-23 17:32:55 +08:00
parent dc01d7fc3e
commit 8487c67bab
9 changed files with 19 additions and 16 deletions

View File

@@ -73,6 +73,9 @@ class Issue < ApplicationRecord
has_many :issue_participants, dependent: :destroy
has_many :participants, through: :issue_participants
has_many :show_participants, -> {joins(:issue_participants).where.not(issue_participants: {participant_type: "atme"}).distinct}, through: :issue_participants, source: :participant
has_many :show_assigners, -> {order("issue_assigners.created_at desc").limit(5)}, through: :issue_assigners, source: :assigner
has_many :show_issue_tags, -> {order("issue_tags_relates.created_at desc").limit(3)}, through: :issue_tags_relates, source: :issue_tag
has_many :comment_journals, -> {where.not(notes: nil)}, class_name: "Journal", :as => :journalized
has_many :operate_journals, -> {where(notes: nil)}, class_name: "Journal", :as => :journalized

View File

@@ -20,7 +20,7 @@ class IssueTagsRelate < ApplicationRecord
after_create :increment_issue_tags_counter_cache
def increment_issue_tags_counter_cache
if self.issue.issue_classify == "Issue"
if self.issue.issue_classify == "issue"
IssueTag.increment_counter :issues_count, issue_tag_id
else
IssueTag.increment_counter :pull_requests_count, issue_tag_id

View File

@@ -28,8 +28,8 @@ class Version < ApplicationRecord
has_many :issues, class_name: "Issue", foreign_key: "fixed_version_id"
belongs_to :user, optional: true
has_many :opened_issues, -> {where(issue_classify: "Issue").where.not(status_id: 5)}, class_name: "Issue", foreign_key: :fixed_version_id
has_many :closed_issues, -> {where(issue_classify: "Issue", status_id: 5)}, class_name: "Issue", foreign_key: :fixed_version_id
has_many :opened_issues, -> {where(issue_classify: "issue").where.not(status_id: 5)}, class_name: "Issue", foreign_key: :fixed_version_id
has_many :closed_issues, -> {where(issue_classify: "issue", status_id: 5)}, class_name: "Issue", foreign_key: :fixed_version_id
scope :version_includes, ->{includes(:issues, :user)}
scope :closed, ->{where(status: 'closed')}