Class: Weasel::EventsWorker
- Inherits:
-
Object
- Object
- Weasel::EventsWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/weasel/workers/events_worker.rb
Instance Method Summary collapse
Instance Method Details
#perform(actor_class, actor_id, request_hash) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/weasel/workers/events_worker.rb', line 5 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 = MultiJson.load(request_hash, symbolize_keys: true) end end |