Skip to content

Commit 047a2d1

Browse files
author
Michiel de Jong
committed
link point to case
1 parent 9fdef39 commit 047a2d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

db/import_points_from_old_db.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def importPoint(data, service)
1515
topicObj = Topic.find_by_title('Personal Data')
1616
serviceObjDefault = Service.find_by_name('amazon')
1717
serviceObj = Service.find_by_name(service) || serviceObjDefault
18+
caseObjDefault = Case.find_by_title('info given about security practices')
19+
caseObj = Case.find_by_title(data['tosdr']['case']) || caseObjDefault
1820
imported_point = Point.new(
1921
# old_id: data['id'] + '-' + service,
2022
title: data['title'],
@@ -24,7 +26,8 @@ def importPoint(data, service)
2426
analysis: "Bla bla bla",
2527
rating: 3,
2628
topic: topicObj,
27-
service: serviceObj
29+
service: serviceObj,
30+
case_id: caseObj.id
2831
)
2932

3033
# validates :title, presence: true

0 commit comments

Comments
 (0)