This repository was archived by the owner on May 25, 2018. It is now read-only.

Description
I added FayeRails and Sidekiq to my rails4 project and tried to use faye subscription with sidekiq-jobs like this:
class FayeMessagesController < FayeRails::Controller
channel '/inspections/inspect_indices' do
subscribe do
Rails.logger.info "FayeMessagesController: Received on channel #{channel}: #{inspect}"
IndexInspectionsWorker.perform_async
end
end
end
Works fine for some time but from time to time, when i change code and reload browser i get the following error:
/home/signify/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:479:in `load_missing_constant': A copy of FayeMessagesController has been removed from the module tree but is still active! (ArgumentError)
from /home/signify/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:184:in `const_missing'
from /home/signify/Projects/chunks/app/realtime/faye_messages_controller.rb:21:in `block (2 levels) in <class:FayeMessagesController>'
from /home/signify/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/faye-rails-2.0.1/lib/faye-rails/controller/channel.rb:47:in `instance_eval'
In general i found a solution but i have no glue how to fix this in that specific case:
http://stackoverflow.com/a/23008837/2560683
Any ideas?