Permalink
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (20 sloc) 729 Bytes
require 'rails/railtie'
module MetaRequest
class Railtie < ::Rails::Railtie
initializer 'meta_request.inject_middlewares' do |app|
app.middleware.use Middlewares::MetaRequestHandler
if defined? ActionDispatch::DebugExceptions
app.middleware.insert_before ActionDispatch::DebugExceptions, Middlewares::Headers, app.config
else
app.middleware.use Middlewares::Headers, app.config
end
app.middleware.use Middlewares::AppRequestHandler
end
initializer 'meta_request.log_interceptor' do
Rails.logger.extend(LogInterceptor) if Rails.logger
end
initializer 'meta_request.subscribe_to_notifications' do
AppNotifications.subscribe
end
end
end