Skip to content

Skip subscribe on test #75

Description

@kuboon

initializer "solid_errors.active_record.error_subscriber" do
Rails.error.subscribe(SolidErrors::Subscriber.new)
end

This line works on every RAILS_ENV.

I wrote ugly workaround on my config/environments/test.rb

config.after_initialize do
    Rails.error.unsubscribe(SolidErrors::Subscriber)
end

Which solution would be better?

  1. Hard cord: Rails.error.subscribe(SolidErrors::Subscriber.new) unless Rails.env.test?
  2. Supply config.rails_error_subscriber (default to true?)
  3. Supply config.rails_error_subscribe_envs (default to ["production"]?)
  4. Add unsubscribe document on README

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions