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,6 +1,6 @@
class AddReportCountToIssues < ActiveRecord::Migration
class AddReportsCountToIssues < ActiveRecord::Migration
def change
add_column :issues, :report_count, :integer, :default => 0
add_column :issues, :reports_count, :integer, :default => 0
add_foreign_key :issues, :users, :column => :updated_by, :name => "issues_updated_by_fkey", :on_delete => :cascade
add_index :issues, :updated_by
end