Sha256: 64fd59d3a1777cf0ec0c9390b118366840d31f6c30cf59fc8945fafd661e71bb

Contents?: true

Size: 690 Bytes

Versions: 78

Compression:

Stored size: 690 Bytes

Contents

module RailsHelper
  def with_railtie(app)
    clear_rails_error_reporter! if Rails.respond_to? :error
    Appsignal::Integrations::Railtie.initialize_appsignal(app)
    yield
  ensure
    clear_rails_error_reporter!
  end

  def with_rails_error_reporter
    if Rails.respond_to? :error
      clear_rails_error_reporter!
      Appsignal::Integrations::Railtie.initialize_error_reporter
    end
    yield
  ensure
    clear_rails_error_reporter!
  end

  def clear_rails_error_reporter!
    return unless Rails.respond_to? :error

    Rails
      .error
      .instance_variable_get(:@subscribers)
      .reject! { |s| s == Appsignal::Integrations::RailsErrorReporterSubscriber }
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
appsignal-3.13.1-java spec/support/helpers/rails_helper.rb
appsignal-3.13.1 spec/support/helpers/rails_helper.rb
appsignal-3.13.1.alpha.1-java spec/support/helpers/rails_helper.rb
appsignal-3.13.1.alpha.1 spec/support/helpers/rails_helper.rb
appsignal-3.13.0-java spec/support/helpers/rails_helper.rb
appsignal-3.13.0 spec/support/helpers/rails_helper.rb
appsignal-3.12.6-java spec/support/helpers/rails_helper.rb
appsignal-3.12.6 spec/support/helpers/rails_helper.rb
appsignal-3.12.5-java spec/support/helpers/rails_helper.rb
appsignal-3.12.5 spec/support/helpers/rails_helper.rb
appsignal-3.12.4-java spec/support/helpers/rails_helper.rb
appsignal-3.12.4 spec/support/helpers/rails_helper.rb
appsignal-3.12.3-java spec/support/helpers/rails_helper.rb
appsignal-3.12.3 spec/support/helpers/rails_helper.rb
appsignal-3.12.2-java spec/support/helpers/rails_helper.rb
appsignal-3.12.2 spec/support/helpers/rails_helper.rb
appsignal-3.12.1-java spec/support/helpers/rails_helper.rb
appsignal-3.12.1 spec/support/helpers/rails_helper.rb
appsignal-3.12.0-java spec/support/helpers/rails_helper.rb
appsignal-3.12.0 spec/support/helpers/rails_helper.rb