Skip to content

Commit

Permalink
Merge pull request #563 from bugsnag/tom/allow-symbols-in-breadcrumbs
Browse files Browse the repository at this point in the history
Allow symbols in breadcrumb meta data
  • Loading branch information
tomlongridge committed Aug 27, 2019
2 parents 083f206 + c1fde6c commit 05f5571
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Changelog
| [#545](https://github.com/bugsnag/bugsnag-ruby/issues/545)
| [#548](https://github.com/bugsnag/bugsnag-ruby/pull/548)

* Allow symbols in breadcrumb meta data.
| [#563](https://github.com/bugsnag/bugsnag-ruby/pull/563)

## 6.11.1 (22 Jan 2019)

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions lib/bugsnag/breadcrumbs/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def validate(breadcrumb)
##
# Tests whether the meta_data types are non-complex objects.
#
# Acceptable types are String, Numeric, TrueClass, FalseClass, and nil.
# Acceptable types are String, Symbol, Numeric, TrueClass, FalseClass, and nil.
#
# @param value [Object] the object to be type checked
def valid_meta_data_type?(value)
value.nil? || value.is_a?(String) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass)
value.nil? || value.is_a?(String) || value.is_a?(Symbol) || value.is_a?(Numeric) || value.is_a?(FalseClass) || value.is_a?(TrueClass)
end
end
end
1 change: 1 addition & 0 deletions spec/breadcrumbs/validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

meta_data = {
:string => "This is a string",
:symbol => :this_is_a_symbol,
:integer => 12345,
:float => 12345.6789,
:false => false,
Expand Down

0 comments on commit 05f5571

Please sign in to comment.