X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/11cc4a5e601dd288d601e6e35a72d159062f18b5..8dc5de1a0f4092dfc7343d3475f00b8a023bea7c:/app/models/changeset_comment.rb diff --git a/app/models/changeset_comment.rb b/app/models/changeset_comment.rb index 529641c7e..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, :integer_only => true } - validates :changeset, :presence => true, :associated => true - validates :author, :presence => true, :associated => true + :numericality => { :on => :update, :only_integer => true } + validates :changeset, :associated => true + validates :author, :associated => true validates :visible, :inclusion => [true, false] validates :body, :characters => true