lib/airbrake/rails/controller_methods.rb in airbrake-3.1.6 vs lib/airbrake/rails/controller_methods.rb in airbrake-3.1.7
- old
+ new
@@ -18,11 +18,11 @@
# This method should be used for sending manual notifications while you are still
# inside the controller. Otherwise it works like Airbrake.notify.
def notify_airbrake(hash_or_exception)
unless airbrake_local_request?
- Airbrake.notify(hash_or_exception, airbrake_request_data)
+ Airbrake.notify_or_ignore(hash_or_exception, airbrake_request_data)
end
end
def airbrake_local_request?
if defined?(::Rails.application.config)
@@ -72,14 +72,14 @@
url
end
def airbrake_current_user
user = begin current_user rescue current_member end
- user.attributes.select do |k, v|
- Airbrake.configuration.
- user_attributes.map(&:to_sym).
- include? k.to_sym unless v.blank?
- end.symbolize_keys
+ h = {}
+ Airbrake.configuration.user_attributes.map(&:to_sym).each do |attr|
+ h[attr.to_sym] = user.send(attr) if user.respond_to? attr
+ end
+ h
rescue NoMethodError, NameError
{}
end
end
end