Sha256: 1f89df53b4864fa093f3db69b62683fddb8dd7e3d3574dce597e2da2259d5f3a
Contents?: true
Size: 409 Bytes
Versions: 13
Compression:
Stored size: 409 Bytes
Contents
class CommentObserver < ActiveRecord::Observer def after_save(comment) # create subscriber CommentSubscriber.create(:commentable => comment.commentable, :email => comment.author_email) if comment.subscribe.to_i == 1 # notify subscribers comment.commentable.subscribers.each {|subscriber| CommentMailer.comment_notification(subscriber.email, comment).deliver} if comment.approved? end end
Version data entries
13 entries across 13 versions & 1 rubygems