about summary refs log tree commit diff
path: root/app/models/mention.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-10-24 11:28:25 +0200
committerGitHub <noreply@github.com>2018-10-24 11:28:25 +0200
commit0e8de56a22aee089da8aa1c64bab941bc5911e5d (patch)
treeac3f4100e27a9341c32c15e07661af841c547ec0 /app/models/mention.rb
parent4739e0f090a04235669ef81fa432ae90bb62f4c4 (diff)
parented8d06212f439b9fe2f170a6f43d6be6d586ff80 (diff)
Merge pull request #792 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/mention.rb')
-rw-r--r--app/models/mention.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/mention.rb b/app/models/mention.rb
index 8ab886b18..d01a88e32 100644
--- a/app/models/mention.rb
+++ b/app/models/mention.rb
@@ -8,6 +8,7 @@
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
 #  account_id :bigint(8)
+#  silent     :boolean          default(FALSE), not null
 #
 
 class Mention < ApplicationRecord
@@ -18,10 +19,17 @@ class Mention < ApplicationRecord
 
   validates :account, uniqueness: { scope: :status }
 
+  scope :active, -> { where(silent: false) }
+  scope :silent, -> { where(silent: true) }
+
   delegate(
     :username,
     :acct,
     to: :account,
     prefix: true
   )
+
+  def active?
+    !silent?
+  end
 end