X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/73426ea3838a2f92f5b766b51e017d529c456471..68481fe7753432ffd3051ede15f7518b1c0d73c9:/app/models/changeset_comment.rb diff --git a/app/models/changeset_comment.rb b/app/models/changeset_comment.rb index 1b78f98e8..d825c9ed5 100644 --- a/app/models/changeset_comment.rb +++ b/app/models/changeset_comment.rb @@ -11,7 +11,10 @@ # # Indexes # -# index_changeset_comments_on_created_at (created_at) +# 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) # # Foreign Keys # @@ -23,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