X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/135ec35a91bcca15637b6436dd7e546468c49690..07cbd7ceed020e4f3ecb4354922e1498e4a348e5:/app/models/changeset_comment.rb diff --git a/app/models/changeset_comment.rb b/app/models/changeset_comment.rb index 75b1a055b..3bc9483fa 100644 --- a/app/models/changeset_comment.rb +++ b/app/models/changeset_comment.rb @@ -11,7 +11,9 @@ # # 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_changeset_id_and_created_at (changeset_id,created_at) +# index_changeset_comments_on_created_at (created_at) # # Foreign Keys # @@ -19,14 +21,14 @@ # changeset_comments_changeset_id_fkey (changeset_id => changesets.id) # -class ChangesetComment < ActiveRecord::Base +class ChangesetComment < ApplicationRecord belongs_to :changeset belongs_to :author, :class_name => "User" validates :id, :uniqueness => true, :presence => { :on => :update }, :numericality => { :on => :update, :only_integer => true } - validates :changeset, :presence => true, :associated => true - validates :author, :presence => true, :associated => true + validates :changeset, :associated => true + validates :author, :associated => true validates :visible, :inclusion => [true, false] validates :body, :characters => true