1
0
Fork 0

Add method ImportPerson#create_aid_at_2014_elections_person_comment

This commit is contained in:
Alex Kotov 2019-07-26 05:18:18 +05:00
parent 2522f86db6
commit c5505435b5
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -11,6 +11,7 @@ class ImportPerson
create_latest_contact_date_person_comment
create_human_readable_id_person_comment
create_past_experience_person_comment
create_aid_at_2014_elections_person_comment
end
end
@ -91,6 +92,19 @@ private
context.past_experience_person_comment.save!
end
def create_aid_at_2014_elections_person_comment
return if aid_at_2014_elections.blank?
context.aid_at_2014_elections_person_comment =
context
.person.person_comments.where(origin: :ait_at_2014_elections).lock(true)
.first_or_initialize
context.aid_at_2014_elections_person_comment.text = ait_at_2014_elections
context.aid_at_2014_elections_person_comment.save!
end
# rubocop:enable Metrics/AbcSize
def person_id
@ -127,4 +141,8 @@ private
def past_experience
context.row[35]
end
def ait_at_2014_elections
context.row[36]
end
end