diff options
author | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-04-03 19:17:20 +0000 |
---|---|---|
committer | Jenkins <jenkins@jenkins.ninjawedding.org> | 2018-04-03 19:17:20 +0000 |
commit | 6611100480c86c07972c1223e7231c136966e11d (patch) | |
tree | d6ce7cf9568d13ba0dfc8ee32fd1335e0d053f43 /app/models/report_note.rb | |
parent | 1f5bdd8445f6ba192618288504b74c1df7c09ea6 (diff) | |
parent | d8d42179590db772cc5b1873385cba7e5afe20df (diff) |
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/models/report_note.rb')
-rw-r--r-- | app/models/report_note.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/models/report_note.rb b/app/models/report_note.rb new file mode 100644 index 000000000..3d12cf7b6 --- /dev/null +++ b/app/models/report_note.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# == Schema Information +# +# Table name: report_notes +# +# id :integer not null, primary key +# content :text not null +# report_id :integer not null +# account_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# + +class ReportNote < ApplicationRecord + belongs_to :account + belongs_to :report, inverse_of: :notes + + scope :latest, -> { reorder('created_at ASC') } + + validates :content, presence: true, length: { maximum: 500 } +end |