Skip to content

Commit

Permalink
feat!: removed traits from event level
Browse files Browse the repository at this point in the history
  • Loading branch information
pallabmaiti committed Sep 12, 2023
1 parent c2e8e16 commit f33d8e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/rudder/analytics/field_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions spec/rudder/analytics/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f33d8e9

Please sign in to comment.