1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/app/models/report_note.rb

22 lines
580 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# == Schema Information
#
# Table name: report_notes
#
# id :bigint(8) not null, primary key
# content :text not null
# report_id :bigint(8) not null
# account_id :bigint(8) not null
# created_at :datetime not null
# updated_at :datetime not null
#
class ReportNote < ApplicationRecord
belongs_to :account
belongs_to :report, inverse_of: :notes, touch: true
2018-12-25 21:38:59 -08:00
scope :latest, -> { reorder(created_at: :desc) }
validates :content, presence: true, length: { maximum: 500 }
end