Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Send user_id instead of id
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvanderbyl committed Dec 13, 2012
1 parent 675b61d commit c7eca7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions lib/crash_log/rails/controller_methods.rb
Expand Up @@ -18,7 +18,7 @@ module ControllerMethods
# }
# end

def crash_log_context(env)
def crash_log_context
payload = {}

payload[:request] = process_request(request.env)
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions lib/crash_log/rails/middleware/debug_exception_catcher.rb
Expand Up @@ -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
Expand Down

0 comments on commit c7eca7e

Please sign in to comment.