Use reports_count so that counter_cache works automatically.

This commit is contained in:
Andy Allan 2017-09-06 17:57:54 +01:00
parent b578cee759
commit 948fd8c8fa
3 changed files with 5 additions and 5 deletions

View file

@ -1,4 +1,4 @@
class Report < ActiveRecord::Base
belongs_to :issue
belongs_to :issue, :counter_cache => true
belongs_to :user, :class_name => "User", :foreign_key => :reporter_user_id
end