Class: Comment

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/comment.rb

Instance Method Summary collapse

Instance Method Details

#deliver_emailObject


19
20
21
# File 'app/models/comment.rb', line 19

def deliver_email
  Mailer.comment_notification(self).deliver
end

#emailable?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'app/models/comment.rb', line 27

def emailable?
  app.emailable? && notification_recipients.any?
end

#notification_recipientsObject


23
24
25
# File 'app/models/comment.rb', line 23

def notification_recipients
  app.notification_recipients - [user.email]
end