diff --git a/lib/crash_log/rails/controller_methods.rb b/lib/crash_log/rails/controller_methods.rb index d627049..62515db 100644 --- a/lib/crash_log/rails/controller_methods.rb +++ b/lib/crash_log/rails/controller_methods.rb @@ -18,7 +18,7 @@ module ControllerMethods # } # end - def crash_log_context(env) + def crash_log_context payload = {} payload[:request] = process_request(request.env) @@ -138,7 +138,11 @@ def crash_log_current_user user_attributes.map(&:to_sym).each do |attribute| if user.respond_to?(attribute) - user_hash[attribute] = user.__send__(attribute) + if attribute.to_sym == :id + user_hash[:user_id] = user.__send__(attribute) + else + user_hash[attribute] = user.__send__(attribute) + end end end diff --git a/lib/crash_log/rails/middleware/debug_exception_catcher.rb b/lib/crash_log/rails/middleware/debug_exception_catcher.rb index 09f8ee9..224843e 100644 --- a/lib/crash_log/rails/middleware/debug_exception_catcher.rb +++ b/lib/crash_log/rails/middleware/debug_exception_catcher.rb @@ -31,13 +31,13 @@ def render_exception_with_crash_log(env, exception) def crash_log_context(controller, env) if controller.respond_to?(:crash_log_context) - controller.crash_log_context(env) + controller.crash_log_context else {} end - # rescue => e - # {} + rescue => e + {} end end