account_moderation_note.rb 687 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: account_moderation_notes
  5. #
  6. # id :bigint(8) not null, primary key
  7. # content :text not null
  8. # account_id :bigint(8) not null
  9. # target_account_id :bigint(8) not null
  10. # created_at :datetime not null
  11. # updated_at :datetime not null
  12. #
  13. class AccountModerationNote < ApplicationRecord
  14. CONTENT_SIZE_LIMIT = 2_000
  15. belongs_to :account
  16. belongs_to :target_account, class_name: 'Account'
  17. scope :chronological, -> { reorder(id: :asc) }
  18. validates :content, presence: true, length: { maximum: CONTENT_SIZE_LIMIT }
  19. end