X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/53817fa9e8d955df0891d156f21b7269b4ed08fc..68481fe7753432ffd3051ede15f7518b1c0d73c9:/app/models/changeset_comment.rb diff --git a/app/models/changeset_comment.rb b/app/models/changeset_comment.rb index 3bc9483fa..d825c9ed5 100644 --- a/app/models/changeset_comment.rb +++ b/app/models/changeset_comment.rb @@ -12,6 +12,7 @@ # Indexes # # index_changeset_comments_on_author_id_and_created_at (author_id,created_at) +# index_changeset_comments_on_author_id_and_id (author_id,id) # index_changeset_comments_on_changeset_id_and_created_at (changeset_id,created_at) # index_changeset_comments_on_created_at (created_at) # @@ -25,6 +26,8 @@ class ChangesetComment < ApplicationRecord belongs_to :changeset belongs_to :author, :class_name => "User" + scope :visible, -> { where(:visible => true) } + validates :id, :uniqueness => true, :presence => { :on => :update }, :numericality => { :on => :update, :only_integer => true } validates :changeset, :associated => true