Class: Formol::PostObserver

Inherits:
ActiveRecord::Observer
  • Object
show all
Defined in:
app/models/formol/post_observer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



3
4
5
# File 'app/models/formol/post_observer.rb', line 3

def self.instance
  super if Formol.config && Formol.config.user_class
end

Instance Method Details

#after_create(post) ⇒ Object



7
8
9
10
11
# File 'app/models/formol/post_observer.rb', line 7

def after_create(post)
  post.topic.subscribers.each do |subscriber|
    SubscriptionMailer.topic_reply(post, subscriber).deliver
  end
end