This commit is contained in:
mgabdev
2020-04-11 18:29:19 -04:00
parent 7249143d9f
commit 595208780e
160 changed files with 1678 additions and 2103 deletions

View File

@@ -43,11 +43,17 @@ class Notification < ApplicationRecord
scope :browserable, ->(exclude_types = [], account_id = nil) {
types = TYPE_CLASS_MAP.values - activity_types_from_types(exclude_types + [:follow_request])
if account_id.nil?
where(activity_type: types)
else
where(activity_type: types, from_account_id: account_id)
end
# if account_id.nil?
puts "-----VERTS------"
Notification.includes(:from_account).where(activity_type: types, accounts: {
is_verified: true
})
# joins(:account).where({ 'from_account.id' => 6 })
# is_verified: false
# )
# els
# where(activity_type: types, from_account_id: account_id)
# end
}
cache_associated :from_account, status: STATUS_INCLUDES, mention: [status: STATUS_INCLUDES], favourite: [:account, status: STATUS_INCLUDES], follow: :account, poll: [status: STATUS_INCLUDES]