Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

David ignores config.coap.only in Rails 5.2 #17

Open
Zyndoras opened this issue Aug 6, 2018 · 0 comments
Open

David ignores config.coap.only in Rails 5.2 #17

Zyndoras opened this issue Aug 6, 2018 · 0 comments

Comments

@Zyndoras
Copy link

Zyndoras commented Aug 6, 2018

I am using david alongside puma to provide a CoAP + HTTP API with Rails 5.2.

While running puma, I noticed that the coap.only option inside my application.rb is ignored on server startup and important middleware classes like Rack::MethodOverride and ActionDispatch::ShowExceptions get removed. That is because in david's default config coap.only is set to true and the options set in application.rb are not yet evaluated at the time the HTTP middleware gets removed.

For everyone who experiences the same issue, I solved this by patching david's default config by placing

require 'david/railties/config'
David::Railties::Config.class_eval do
  config.coap.only = false
end

before the Bundler.require(*Rails.groups) line in my application.rb.

Cheers,
Alex

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant