Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow the explicit definition of user attributes

  • Loading branch information...
commit 114fea91e848c048f3d49a83a27d87f3e8090f63 1 parent fc30a23
@elandesign elandesign authored
View
2  airbrake_user_attributes.gemspec
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
s.add_development_dependency("sham_rack", "~> 1.3.0")
s.add_development_dependency("shoulda", "~> 2.11.3")
- s.add_dependency 'airbrake', '3.0.9'
+ s.add_dependency 'airbrake', '>= 3.0.9'
end
View
5 lib/airbrake/current_user.rb
@@ -13,9 +13,10 @@ def self.filtered_attributes(controller)
end
# Return empty hash if there are no users.
return {} unless user && user.respond_to?(:attributes)
-
+ unfiltered_attributes = user.respond_to?(:attributes_for_airbrake) ? user.attributes_for_airbrake : user.attributes
+
# Removes auth-related fields
- attributes = user.attributes.reject do |k, v|
+ attributes = unfiltered_attributes.reject do |k, v|
/password|token|login|sign_in|per_page|_at$/ =~ k
end
# Try to include a URL for the user, if possible.
Please sign in to comment.
Something went wrong with that request. Please try again.