Permalink
Browse files

Use component and environment_name instead of controller and rails_en…

…v in the error lookup hash.
  • Loading branch information...
1 parent d17798e commit ef0238487d532f05a027a8c90f316b9483fd83d3 @tristandunn tristandunn committed Nov 9, 2009
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/hoptoad_notifier.rb
  2. +2 −2 test/notifier_test.rb
View
8 lib/hoptoad_notifier.rb
@@ -105,10 +105,10 @@ def build_lookup_hash_for(exception, options = {})
notice = build_notice_for(exception, options)
result = {}
- result[:rails_env] = 'production'
- result[:action] = notice.action rescue nil
- result[:controller] = notice.controller rescue nil
- result[:error_class] = notice.error_class if notice.error_class
+ result[:action] = notice.action rescue nil
+ result[:component] = notice.component rescue nil
+ result[:error_class] = notice.error_class if notice.error_class
+ result[:environment_name] = 'production'
unless notice.backtrace.lines.empty?
result[:file] = notice.backtrace.lines.first.file
View
4 test/notifier_test.rb
@@ -148,7 +148,7 @@ def set_development_env
end
should "set controller" do
- assert_equal @params[:controller], @hash[:controller]
+ assert_equal @params[:controller], @hash[:component]
end
should "set line number" do
@@ -160,7 +160,7 @@ def set_development_env
end
should "set rails_env to production" do
- assert_equal 'production', @hash[:rails_env]
+ assert_equal 'production', @hash[:environment_name]
end
should "set error class" do

0 comments on commit ef02384

Please sign in to comment.