Sha256: c9c20432492dfcec9d9af30e87b68a46b5f352b505d2a5615005437c27476fc0

Contents?: true

Size: 690 Bytes

Versions: 11

Compression:

Stored size: 690 Bytes

Contents

require "mongoid/publishable/queue"

module Mongoid
  module Publishable
    module Queuing
      def self.included(base)
        base.class_eval do
          before_filter :deserialize_publishing_queue
          after_filter  :serialize_publishing_queue
          attr_reader   :publishing_queue
        end
        base.send(:include, InstanceMethods)
      end
      
      module InstanceMethods
        protected
        def deserialize_publishing_queue
          @publishing_queue = Queue.load(session[:publishing_queue])
        end
        
        def serialize_publishing_queue
          session[:publishing_queue] = @publishing_queue.dump
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mongoid-publishable-0.4.0 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.3.2 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.3.1 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.2.1 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.2.0 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.1.0 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.0.5 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.0.4 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.0.3 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.0.2 lib/mongoid/publishable/queuing.rb
mongoid-publishable-0.0.1 lib/mongoid/publishable/queuing.rb