Skip to content

Commit

Permalink
[#24] Change initializer order only for older Rails versions (< 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ridiculous committed Mar 8, 2019
1 parent 3e64a80 commit db00fe6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/grape/middleware/logger/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Grape::Middleware::Logger::Railtie < Rails::Railtie
initializer 'grape.middleware.logger', after: :load_config_initializers do
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
end
Expand Down

0 comments on commit db00fe6

Please sign in to comment.