about summary refs log tree commit diff
path: root/app/models/account_moderation_note.rb
diff options
context:
space:
mode:
authornullkal <nullkal@nil.nu>2017-10-08 03:26:43 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-10-07 20:26:43 +0200
commit633426b2616e8559acfa76f4294a51afcf434fc2 (patch)
tree38759fbbd11bb3b40bc29e1a0f8ce048d15c7ce3 /app/models/account_moderation_note.rb
parentf486ef2666dacbcb6fcd26e371bb5e945369dcfe (diff)
Add moderation note (#5240)
* Add moderation note

* Add frozen_string_literal

* Make rspec pass
Diffstat (limited to 'app/models/account_moderation_note.rb')
-rw-r--r--app/models/account_moderation_note.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/models/account_moderation_note.rb b/app/models/account_moderation_note.rb
new file mode 100644
index 000000000..be52d10b6
--- /dev/null
+++ b/app/models/account_moderation_note.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+# == Schema Information
+#
+# Table name: account_moderation_notes
+#
+#  id                :integer          not null, primary key
+#  content           :text             not null
+#  account_id        :integer
+#  target_account_id :integer
+#  created_at        :datetime         not null
+#  updated_at        :datetime         not null
+#
+
+class AccountModerationNote < ApplicationRecord
+  belongs_to :account
+  belongs_to :target_account, class_name: 'Account'
+
+  scope :latest, -> { reorder('created_at DESC') }
+
+  validates :content, presence: true, length: { maximum: 500 }
+end