Module: Pheromone::ClassMethods

Defined in:
lib/pheromone.rb

Overview

class methods for the model including Publishable

Instance Method Summary collapse

Instance Method Details

#publish(message_options) ⇒ Object



38
39
40
41
42
# File 'lib/pheromone.rb', line 38

def publish(message_options)
  errors = OptionsValidator.new(message_options).validate
  raise "Errors: #{errors}" unless errors.empty?
  __send__(:after_commit, proc { dispatch_messages(message_options: message_options) })
end