Merge 18433a6776 into 749115e507
This commit is contained in:
commit
a0cdc60ca5
8 changed files with 28 additions and 13 deletions
|
|
@ -57,13 +57,19 @@ class Comment < ApplicationRecord
|
|||
commentable_str.constantize.find(commentable_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def send_notification
|
||||
EventCommentMailJob.perform_later(self)
|
||||
end
|
||||
|
||||
def conference_id
|
||||
commentable.program.conference_id
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def conference
|
||||
commentable.program.conference
|
||||
end
|
||||
|
||||
def send_notification
|
||||
return unless conference.email_settings.send_on_event_comment?
|
||||
|
||||
EventCommentMailJob.perform_later(self)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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