]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/report.rb
Use reports_count so that counter_cache works automatically.
[rails.git] / app / models / report.rb
index f997215a8b062b6cf28e037767e98fbe6786ced8..477b4b1824842d37997e8cc2e05054dbf5dc4706 100644 (file)
@@ -1,5 +1,4 @@
 class Report < ActiveRecord::Base
-       belongs_to :issue
-       belongs_to :user, :class_name => "User", :foreign_key => :reporter_user_id
-       
+  belongs_to :issue, :counter_cache => true
+  belongs_to :user, :class_name => "User", :foreign_key => :reporter_user_id
 end