lib/marlowe/rails.rb in marlowe-2.1 vs lib/marlowe/rails.rb in marlowe-3.0
- old
+ new
@@ -4,26 +4,24 @@
class Railtie < Rails::Railtie # :nodoc:
initializer "marlowe.configure_rails_initialization" do
config = app.config
opts = {
- header: config.try(:marlowe_header) || config.try(:marlowe_correlation_header),
- handler: config.try(:marlowe_request_id_handler),
- return: config.try(:marlowe_return_request_id),
- action_dispatch: config.try(:marlowe_replace_action_dispatch_request_id)
+ header: config&.marlowe_header || config&.marlowe_correlation_header,
+ handler: config&.marlowe_request_id_handler,
+ return: config&.marlowe_return_request_id,
+ action_dispatch: config&.marlowe_replace_action_dispatch_request_id
}.compact
if opts[:action_dispatch]
- app.middleware.insert_before ActionDispatch::RequestId,
- Marlowe::Middleware, opts
+ app.middleware.insert_before ActionDispatch::RequestId, Marlowe::Middleware, opts
app.middleware.delete ActionDispatch::RequestId
else
- app.middleware.insert_before Rails::Rack::Logger, Marlowe::Middleware,
- opts
+ app.middleware.insert_before Rails::Rack::Logger, Marlowe::Middleware, opts
end
end
- def app #:nodoc:
+ def app # :nodoc:
Rails.application
end
end
end