Permalink
Browse files

Merge pull request #599 from Talvalin/issue_2575_unposted_chapter_wor…

…dcount

Word count now checks if a chapter has been posted
  • Loading branch information...
2 parents b06e7bb + 17e2d23 commit 57f0ee77f12cd798af88c994a1c5835ebc65c1a8 @elzj elzj committed May 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/work.rb
View
@@ -574,7 +574,7 @@ def set_word_count
if self.new_record?
self.word_count = self.chapters.first.set_word_count
else
- self.word_count = Chapter.select("SUM(word_count) AS work_word_count").where(:work_id => self.id).first.work_word_count
+ self.word_count = Chapter.select("SUM(word_count) AS work_word_count").where(:work_id => self.id, :posted => true).first.work_word_count
end
end

0 comments on commit 57f0ee7

Please sign in to comment.