rollbar-gem icon indicating copy to clipboard operation
rollbar-gem copied to clipboard

Support any object as extra data when notifying errors

Open bagedevimo opened this issue 4 years ago • 1 comments

Currently the extra_data support in rollbar-ruby relies on the object being of a specific set of types. This is a bit uncessary, as we do support hashes. So instead of limiting the types by their class name, lets instead check the response to to_h (which always returns hash) and then treat the result as a hash.

This enables support for a larger number of extra_data objects being passed in, including ActiveModel::Errors, the original object that was being passed in at my work.

bagedevimo avatar Jun 09 '20 01:06 bagedevimo

@bagedevimo Thank you for the PR. A release is coming up in the next couple days. I'd be happy to merge this change if you can update the hash syntax in the spec.

waltjones avatar Jun 18 '20 01:06 waltjones