X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a4edd3fd04b3f97fcff2fd77977fd2e2324f30d8..aabe8815b304998263a2e670dcf7e02800471e22:/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