Sha256: 0789c52067a06571ad39a256ff05672992ec3ef7b49025cf92424131a45c7bb6

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

module ActionController
  module Railties
    # Used to monkey patch all the inherited calls in action_pack
    #
    # This is the usual entry point for Rails inheritance work, so it should
    # catch most of the calls to inherited.
    module Helpers
      alias_method :cs__patched_inherited, :inherited
      def inherited klass
        klass&.instance_variable_set(:@cs__defining_class, true)
        cs__patched_inherited(klass)
      ensure
        klass&.instance_variable_set(:@cs__defining_class, false)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
contrast-agent-3.11.0 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
contrast-agent-3.10.2 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
contrast-agent-3.10.1 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
contrast-agent-3.10.0 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
contrast-agent-3.9.1 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
contrast-agent-3.9.0 lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb