issue回复添加到积分统计

This commit is contained in:
huang 2016-01-14 15:52:14 +08:00
parent 286418b63c
commit 01e8730b25
1 changed files with 3 additions and 3 deletions

View File

@ -219,15 +219,15 @@ class Journal < ActiveRecord::Base
def decrease_issues_journal_count
unless self.issue.project.nil?
project = self.issue.project
project.update_attribute(:journals_count, project.journals_count - 1)
project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num - 1)
end
end
# issue留言总数更新
def add_journals_count
if !self.issue.project.nil? && self.journalized_type == "Issue" && self.issue.project.project_score.nil?
if !self.issue.project.nil? && self.journalized_type == "Issue" && !self.issue.project.project_score.nil?
project = self.issue.project
project.project_score.update_attribute(:issue_journal_num, project.project_score.journals_count + 1)
project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1)
end
end
end