Skip to content

Commit

Permalink
be compatible with Rails 5 also
Browse files Browse the repository at this point in the history
fixes #16
  • Loading branch information
thomasritz committed Sep 30, 2021
1 parent 3d290e6 commit ef18029
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/crm/core/log_subscriber.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
require "active_support/parameter_filter"
if ActiveSupport.version >= Gem::Version.new("6.0.0")
require "active_support/parameter_filter"
else
require "action_dispatch"
end

module Crm; module Core
class LogSubscriber < ActiveSupport::LogSubscriber
Expand Down Expand Up @@ -35,7 +39,12 @@ def establish_connection(event)
private

def parameter_filter
@parameter_filter ||= ::ActiveSupport::ParameterFilter.new(['password'])
@parameter_filter ||=
if ActiveSupport.version >= Gem::Version.new("6.0.0")
::ActiveSupport::ParameterFilter.new(['password'])
else
::ActionDispatch::Http::ParameterFilter.new(['password'])
end
end
end
end; end

0 comments on commit ef18029

Please sign in to comment.