| @@ -50,7 +50,7 @@ | |||||
| class Issue < ApplicationRecord | class Issue < ApplicationRecord | ||||
| #issue_type 1为普通,2为悬赏 | #issue_type 1为普通,2为悬赏 | ||||
| belongs_to :project, :counter_cache => true | |||||
| belongs_to :project, counter_cache: true, touch: true | |||||
| belongs_to :tracker,optional: true | belongs_to :tracker,optional: true | ||||
| has_many :project_trends, as: :trend, dependent: :destroy | has_many :project_trends, as: :trend, dependent: :destroy | ||||
| has_one :pull_request | has_one :pull_request | ||||
| @@ -31,7 +31,7 @@ class PullRequest < ApplicationRecord | |||||
| belongs_to :issue | belongs_to :issue | ||||
| belongs_to :user | belongs_to :user | ||||
| belongs_to :project, :counter_cache => true | |||||
| belongs_to :project, counter_cache: true, touch: true | |||||
| # belongs_to :fork_project, foreign_key: :fork_project_id | # belongs_to :fork_project, foreign_key: :fork_project_id | ||||
| has_many :pull_request_assigns, foreign_key: :pull_request_id | has_many :pull_request_assigns, foreign_key: :pull_request_id | ||||
| has_many :pull_request_tags, foreign_key: :pull_request_id | has_many :pull_request_tags, foreign_key: :pull_request_id | ||||
| @@ -24,7 +24,7 @@ | |||||
| # | # | ||||
| class Version < ApplicationRecord | class Version < ApplicationRecord | ||||
| belongs_to :project, counter_cache: true | |||||
| belongs_to :project, counter_cache: true, touch: true | |||||
| has_many :issues, class_name: "Issue", foreign_key: "fixed_version_id" | has_many :issues, class_name: "Issue", foreign_key: "fixed_version_id" | ||||
| belongs_to :user, optional: true | belongs_to :user, optional: true | ||||