diff --git a/lib/rudder/analytics/field_parser.rb b/lib/rudder/analytics/field_parser.rb index 307c50e..d4bb6f1 100644 --- a/lib/rudder/analytics/field_parser.rb +++ b/lib/rudder/analytics/field_parser.rb @@ -169,7 +169,8 @@ def parse_common_fields(fields) # rubocop:disable Metrics/AbcSize Metrics/Cyclom traits = fields[:traits] check_is_hash!(traits, 'traits') isoify_dates! traits - parsed = parsed.merge({ :traits => traits }) + # remove top level traits + # parsed = parsed.merge({ :traits => traits }) end parsed end diff --git a/spec/rudder/analytics/client_spec.rb b/spec/rudder/analytics/client_spec.rb index 7252ba4..5984f60 100644 --- a/spec/rudder/analytics/client_spec.rb +++ b/spec/rudder/analytics/client_spec.rb @@ -138,7 +138,8 @@ class Analytics }) message = queue.pop - traits = message[:traits] + context = message[:context] + traits = context[:traits] date_time = DateTime.new(2013, 1, 1) expect(Time.iso8601(traits[:time])).to eq(date_time) @@ -203,7 +204,8 @@ class Analytics }) message = queue.pop - traits = message[:traits] + context = message[:context] + traits = context[:traits] date_time = DateTime.new(2013, 1, 1) expect(Time.iso8601(traits[:time])).to eq(date_time)