[openstreetmap/openstreetmap-website] Add counts for notes and diary comments to user profiles (#1774)
notifications at github.com
Thu Mar 1 21:15:33 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
I think `note_comments_count` is less accurate because we're not counting the number of comments but rather the number of authored notes. So `note_comments_count` isn't exactly right because a user can comment multiple times on a note but maybe `note_authored_count` is a better name?
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