diff --git a/CHANGELOG.md b/CHANGELOG.md index f18527090..e82a050be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/bugsnag/breadcrumbs/validator.rb b/lib/bugsnag/breadcrumbs/validator.rb index 64eabb434..c6893b50a 100644 --- a/lib/bugsnag/breadcrumbs/validator.rb +++ b/lib/bugsnag/breadcrumbs/validator.rb @@ -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 diff --git a/spec/breadcrumbs/validator_spec.rb b/spec/breadcrumbs/validator_spec.rb index 34de2c20d..07e7b2c5b 100644 --- a/spec/breadcrumbs/validator_spec.rb +++ b/spec/breadcrumbs/validator_spec.rb @@ -64,6 +64,7 @@ meta_data = { :string => "This is a string", + :symbol => :this_is_a_symbol, :integer => 12345, :float => 12345.6789, :false => false,