Skip to content

Commit

Permalink
for rails < 6.0.0 still use ActionDispatch::Http::ParameterFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
aserafin committed Sep 10, 2019
1 parent 3eef054 commit 4bced79
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/grape_logging/util/parameter_filter.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
if defined?(::Rails.application)
class ParameterFilter < ActiveSupport::ParameterFilter
def initialize(_replacement, filter_parameters)
super(filter_parameters)
if Gem::Version.new(Rails.version) < Gem::Version.new('6.0.0')
class ParameterFilter < ActionDispatch::Http::ParameterFilter
def initialize(_replacement, filter_parameters)
super(filter_parameters)
end
end
else
class ParameterFilter < ActiveSupport::ParameterFilter
def initialize(_replacement, filter_parameters)
super(filter_parameters)
end
end
end
else
Expand Down

0 comments on commit 4bced79

Please sign in to comment.