Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Rails 6.1 for Rails.application.class.parent_name.underscore #503

Open
quorak opened this issue Jan 20, 2021 · 2 comments
Open

Comments

@quorak
Copy link

quorak commented Jan 20, 2021

Steps to reproduce

  1. upgrade to Rails 6.1
  2. use mattermost exception_notifier (but probably any)
  3. throw exception

Expected behavior

exception gets send to backend

Actual behavior

[2021-01-19T08:11:38.595375 #1]  WARN -- : An error occurred when sending a notification using 'mattermost' notifier.NoMethodError: undefined method `parent_name' for XXX::Application:Class
/usr/local/bundle/gems/railties-6.1.1/lib/rails/railtie.rb:209:in `method_missing'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier/modules/formatter.rb:114:in `rails_app_name'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier/modules/formatter.rb:17:in `initialize'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier/mattermost_notifier.rb:11:in `new'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier/mattermost_notifier.rb:11:in `call'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier.rb:162:in `fire_notification'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier.rb:71:in `block in notify_exception'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier.rb:69:in `each'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notifier.rb:69:in `notify_exception'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notification/rack.rb:59:in `rescue in call'
/usr/local/bundle/gems/exception_notification-4.4.3/lib/exception_notification/rack.rb:48:in `call'

System configuration

Rails version: 6.1
Ruby version: 2.7.1

quorak added a commit to quorak/exception_notification that referenced this issue Jan 20, 2021
smartinez87 added a commit that referenced this issue Jan 20, 2021
#503 Use module_parent_name for rails 6 upwards
@jmlacroix
Copy link

@quorak you're right, it also happens with a custom notifier.

@smartinez87 any plan on releasing an updated gem version or should I source from master for the time being?

Anyhow, thanks to both of you for your work in this! 🙏

@jaysonvirissimo
Copy link

Looks like this issue has already been addressed, so can be safely closed now.

cc @smartinez87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants