Hi. I have problem with setting model observer for my Message model. My Faye cotroller:
app/realtime/realtime_message_controller.rb
class RealtimeMessageController < FayeRails::Controller
observe Message, :after_create do |msg|
RealtimeMessageController.publish('/messages/new', msg.attributes)
end
end
config/application.rb
config.middleware.delete Rack::Lock
config.middleware.use FayeRails::Middleware, mount: '/faye', :timeout => 25 do
map '/messages/new' => RealtimeMessageController
map :default => :block
end
When i try to start app, i get this error:
faye-rails-2.0.0/lib/faye-rails/controller/observer_factory.rb:17:in
`const_set': wrong constant name FayeRails::Controller::MessageCallbacks (NameError)
Hi. I have problem with setting model observer for my Message model. My Faye cotroller:
app/realtime/realtime_message_controller.rb
config/application.rb
When i try to start app, i get this error:
Ruby 2.2.0 Rails 4.2.0
Thanks for help