]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note_comment.rb
Merge remote-tracking branch 'upstream/pull/5667'
[rails.git] / app / models / note_comment.rb
index b870e5558e557b2f2c337586206daf5ac6b8c356..3f34368fa8073608723656f1043b0462945772c0 100644 (file)
@@ -2,12 +2,12 @@
 #
 # Table name: note_comments
 #
 #
 # 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
 #  visible    :boolean          not null
 #  created_at :datetime         not null
 #  author_ip  :inet
-#  author_id  :bigint(8)
+#  author_id  :bigint
 #  body       :text
 #  event      :enum
 #
 #  body       :text
 #  event      :enum
 #
@@ -26,7 +26,7 @@
 
 class NoteComment < ApplicationRecord
   belongs_to :note, :touch => true
 
 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 }
 
   validates :id, :uniqueness => true, :presence => { :on => :update },
                  :numericality => { :on => :update, :only_integer => true }