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