about summary refs log tree commit diff
path: root/app/models/block.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-03 17:11:54 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-03 17:12:13 +0200
commit9d59d7b463e7f31ceedf27775a7ee3e8e071b4a1 (patch)
tree6623a9795e3b6fc755b11caa132211f56acfed32 /app/models/block.rb
parenta488b05726b2e93b5f66e93ef700a6bc32a3a029 (diff)
Adding a block model and filter mentions from blocked users (fix #60)
Diffstat (limited to 'app/models/block.rb')
-rw-r--r--app/models/block.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/block.rb b/app/models/block.rb
new file mode 100644
index 000000000..418afdbdf
--- /dev/null
+++ b/app/models/block.rb
@@ -0,0 +1,7 @@
+class Block < ApplicationRecord
+  belongs_to :account
+  belongs_to :target_account, class_name: 'Account'
+
+  validates :account, :target_account, presence: true
+  validates :account_id, uniqueness: { scope: :target_account_id }
+end