Sha256: f153b51f62c9cbba7b6f0d0825f5f5033b73fd9f22bd996b113cbf2778be0dca

Contents?: true

Size: 641 Bytes

Versions: 13

Compression:

Stored size: 641 Bytes

Contents

module Quebert
  module AsyncSender
    
    # I'm not sure if I want to do this or build serializers per type of object...
    module ActiveRecord
      class RecordJob < Job
        def perform(record, meth, *args)
          record.send(meth, *args)
        end
      end
      
      def self.included(base)
        base.send(:include, InstanceMethods)
        base.send(:include, AsyncSender::Object)
      end
      
      module InstanceMethods
        # The meat of dealing with ActiveRecord instances.
        def async_send(meth, *args)
          RecordJob.new(self, meth, *args).enqueue
        end
      end
    end
    
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
quebert-1.12.0 lib/quebert/async_sender/active_record.rb
quebert-1.11.0 lib/quebert/async_sender/active_record.rb
quebert-1.0.9 lib/quebert/async_sender/active_record.rb
quebert-1.0.8 lib/quebert/async_sender/active_record.rb
quebert-1.0.7 lib/quebert/async_sender/active_record.rb
quebert-1.0.6 lib/quebert/async_sender/active_record.rb
quebert-1.0.5 lib/quebert/async_sender/active_record.rb
quebert-1.0.4 lib/quebert/async_sender/active_record.rb
quebert-1.0.2 lib/quebert/async_sender/active_record.rb
quebert-1.0.1 lib/quebert/async_sender/active_record.rb
quebert-1.0.0 lib/quebert/async_sender/active_record.rb
quebert-0.0.9 lib/quebert/async_sender/active_record.rb
quebert-0.0.8 lib/quebert/async_sender/active_record.rb