Simplify User.comment_notifiable scope
This commit is contained in:
parent
c9f410e68a
commit
9d4af0dcd3
4 changed files with 8 additions and 10 deletions
|
|
@ -37,7 +37,7 @@ class User < ApplicationRecord
|
|||
after_save :touch_events
|
||||
|
||||
# add scope
|
||||
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
|
||||
scope :comment_notifiable, ->(conference_id) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference_id)}
|
||||
|
||||
# scopes for user distributions
|
||||
scope :recent, lambda {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue