Module: Banter::DelayPublishModel

Defined in:
lib/banter/delay_publish_model.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/banter/delay_publish_model.rb', line 3

def self.included(base)

  # a little esoteric, but this overrides the transaction so that the messages can be delayed.
  base.instance_eval do
    def transaction
      Banter.delay_messages{ super { yield } }
    end
  end

end