[openstreetmap/openstreetmap-website] Add counts for notes and diary comments to user profiles (#1774)
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...
More information about the rails-dev