lib/grape/middleware/logger/railtie.rb in grape-middleware-logger-1.11.0 vs lib/grape/middleware/logger/railtie.rb in grape-middleware-logger-1.12.0
- old
+ new
@@ -1,7 +1,12 @@
class Grape::Middleware::Logger::Railtie < Rails::Railtie
options = Rails::VERSION::MAJOR < 5 ? { after: :load_config_initializers } : {}
initializer 'grape.middleware.logger', options do
Grape::Middleware::Logger.logger = Rails.application.config.logger || Rails.logger.presence
- Grape::Middleware::Logger.filter = ActionDispatch::Http::ParameterFilter.new Rails.application.config.filter_parameters
+ parameter_filter_class = if Rails::VERSION::MAJOR >= 6
+ ActiveSupport::ParameterFilter
+ else
+ ActionDispatch::Http::ParameterFilter
+ end
+ Grape::Middleware::Logger.filter = parameter_filter_class.new Rails.application.config.filter_parameters
end
end