mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
Prevent doubles in the database when importing points
This commit is contained in:
parent
6f9d23017b
commit
3f146b34c7
2 changed files with 3 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ class GoogleMaps::TimelineParser
|
|||
points_data = parse_json
|
||||
|
||||
points_data.each do |point_data|
|
||||
# next if Point.exists?(timestamp: point_data[:timestamp])
|
||||
next if Point.exists?(timestamp: point_data[:timestamp])
|
||||
|
||||
Point.create(
|
||||
latitude: point_data[:latitude],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ class OwnTracks::ExportParser
|
|||
points_data = parse_json
|
||||
|
||||
points_data.each do |point_data|
|
||||
next if Point.exists?(timestamp: point_data[:timestamp], tracker_id: point_data[:tracker_id])
|
||||
|
||||
Point.create(
|
||||
latitude: point_data[:latitude],
|
||||
longitude: point_data[:longitude],
|
||||
|
|
|
|||
Loading…
Reference in a new issue