Do not pass AR objects to Sidekiq

In the new version Sidekiq calls JSON.generate on the passed arguments, which blows up with AR objects
This commit is contained in:
Jonne Haß 2013-05-17 14:44:57 +02:00
parent e8f57d8fac
commit 32935be9b1

View file

@ -40,6 +40,11 @@ class Postzord::Dispatcher
if opts[:additional_subscribers].present?
opts[:additional_subscribers] = [*opts[:additional_subscribers]].map(&:id)
end
if opts[:to].present?
opts[:to] = [opts[:to]].flatten(1).map {|e| e.respond_to?(:id) ? e.id : e }
end
Workers::DeferredDispatch.perform_async(user.id, object.class.to_s, object.id, opts)
end