about summary refs log tree commit diff
path: root/app/models/account_note.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account_note.rb')
-rw-r--r--app/models/account_note.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/account_note.rb b/app/models/account_note.rb
new file mode 100644
index 000000000..bf61df923
--- /dev/null
+++ b/app/models/account_note.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+# == Schema Information
+#
+# Table name: account_notes
+#
+#  id                :bigint(8)        not null, primary key
+#  account_id        :bigint(8)
+#  target_account_id :bigint(8)
+#  comment           :text             not null
+#  created_at        :datetime         not null
+#  updated_at        :datetime         not null
+#
+class AccountNote < ApplicationRecord
+  include RelationshipCacheable
+
+  belongs_to :account
+  belongs_to :target_account, class_name: 'Account'
+
+  validates :account_id, uniqueness: { scope: :target_account_id }
+end