Sha256: 07eb70df3f4685038ab56254a21e6d1ea8d9e0bc5796774014ca78e690098e43

Contents?: true

Size: 392 Bytes

Versions: 5

Compression:

Stored size: 392 Bytes

Contents

module Mongoid
  module Publish
    module Callbacks
      extend ActiveSupport::Concern
      
      CALLBACKS = [
        :after_publish,
        :before_publish
      ].freeze

      included do
        extend ActiveModel::Callbacks

        define_model_callbacks :publish

        def publish!          
          run_callbacks(:publish) { super }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
publish-0.4.0 lib/mongoid/publish/callbacks.rb
publish-0.3.0 lib/mongoid/publish/callbacks.rb
publish-0.2.0 lib/mongoid/publish/callbacks.rb
publish-0.1.2 lib/mongoid/publish/callbacks.rb
publish-0.1.1 lib/mongoid/publish/callbacks.rb