Sha256: 6dc09107e806a20540a401a67687f698350028cc525f3727fcee179ec41660a5

Contents?: true

Size: 362 Bytes

Versions: 10

Compression:

Stored size: 362 Bytes

Contents

module Weasel
  class EventsWorker
    include Sidekiq::Worker

    def perform(actor_class, actor_id, request_hash)
      return if actor_class.nil? || actor_id.nil? || request_hash.empty?

      Weasel::Event.create do |object|
        object.actor = actor_class.constantize.find(actor_id)
        object.action_data = request_hash
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
weasel-3.0.2 lib/weasel/workers/events_worker.rb
weasel-3.0.1 lib/weasel/workers/events_worker.rb
weasel-3.0.0 lib/weasel/workers/events_worker.rb
weasel-2.0.0 lib/weasel/workers/events_worker.rb
weasel-1.1.0 lib/weasel/workers/events_worker.rb
weasel-0.2.9 lib/weasel/workers/events_worker.rb
weasel-0.2.8 lib/weasel/workers/events_worker.rb
weasel-0.2.7 lib/weasel/workers/events_worker.rb
weasel-0.2.6 lib/weasel/workers/events_worker.rb
weasel-0.2.5 lib/weasel/workers/events_worker.rb