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 }