Add note and diary comments counts to the user profile

Fixes #1643
This commit is contained in:
Nenad Vujicic 2024-06-03 14:58:23 +02:00
parent 67be6616b0
commit a4d3d324ec
6 changed files with 72 additions and 33 deletions

View file

@ -26,7 +26,7 @@
class NoteComment < ApplicationRecord
belongs_to :note, :touch => true
belongs_to :author, :class_name => "User", :optional => true
belongs_to :author, :class_name => "User", :optional => true, :counter_cache => true
validates :id, :uniqueness => true, :presence => { :on => :update },
:numericality => { :on => :update, :only_integer => true }