[openstreetmap/openstreetmap-website] Add counts for notes and diary comments to user profiles (#1774)

Aaron Lidman notifications at github.com
Thu Mar 1 21:33:57 UTC 2018

aaronlidman commented on this pull request.

> @@ -25,7 +25,7 @@
 class NoteComment < ActiveRecord::Base
   belongs_to :note, :foreign_key => :note_id, :touch => true
-  belongs_to :author, :class_name => "User", :foreign_key => :author_id
+  belongs_to :author, :class_name => "User", :foreign_key => :author_id, :counter_cache => :notes_count

Ah that's right, I misunderstood.

Since there's no distinction of an author in the `Note` class, do you have a recommendation for how to count just the first comment on a note? That logic would have to be within the `NoteComment` class right?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180301/f486d625/attachment.html>

More information about the rails-dev mailing list