X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/945df0f150ea803e1a654b03155ecdb444c6ed1c..b8b9c3d1e9e412178426e9ba1b612e14e09f2320:/app/models/note_comment.rb diff --git a/app/models/note_comment.rb b/app/models/note_comment.rb index b870e5558..3f34368fa 100644 --- a/app/models/note_comment.rb +++ b/app/models/note_comment.rb @@ -2,12 +2,12 @@ # # Table name: note_comments # -# id :bigint(8) not null, primary key -# note_id :bigint(8) not null +# id :bigint not null, primary key +# note_id :bigint not null # visible :boolean not null # created_at :datetime not null # author_ip :inet -# author_id :bigint(8) +# author_id :bigint # body :text # event :enum # @@ -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 }