Skip to content

Instantly share code, notes, and snippets.

@marclove
Last active August 29, 2015 13:57
Show Gist options
  • Save marclove/9378689 to your computer and use it in GitHub Desktop.
Save marclove/9378689 to your computer and use it in GitHub Desktop.
class CommentCreator
#...
def perform
ThreadParticipantsNotifier.new(@comment).notify
CommentReplyNotifier.new(@comment).notify
Kissmetrics.record(comment.author, 'Added Comment')
end
end
class CommentReplyNotifier
def initialize(comment)
@comment = comment
end
def notify
if previous_comment?
ReplyMailer.notification(in_reply_to_user, @comment).deliver
end
end
private
def previous_comment?
!!previous_comment
end
def previous_comment
@comment.previous_comment
end
def in_reply_to_user
previous_comment.author
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment