Skip to content

Commit 50f19be

Browse files
committed
Outsource the appending of the name to make rubocop happy :)
1 parent 261a473 commit 50f19be

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/domain/ptime/people_employees.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def update_person_data(person)
2828
end
2929
end
3030
set_additional_attributes(person, ptime_employee)
31+
set_full_name(person, ptime_employee)
3132
person.save!
3233
person
3334
end
@@ -40,13 +41,15 @@ def set_additional_attributes(person, ptime_employee)
4041
person.nationality = ptime_employee_nationalities[0]
4142
person.nationality2 = ptime_employee_nationalities[1]
4243

43-
first_name = ptime_employee[:attributes][:firstname].presence || ''
44-
last_name = ptime_employee[:attributes][:lastname].presence || ''
45-
person[:name] = "#{first_name} #{last_name}".strip
46-
4744
# temporary until the Ptime API gets updated
4845
person.birthdate = DateTime.new(2000, 2, 3)
4946
person.location = 'Boston, MA'
5047
end
48+
49+
def set_full_name(person, ptime_employee)
50+
first_name = ptime_employee[:attributes][:firstname].presence || ''
51+
last_name = ptime_employee[:attributes][:lastname].presence || ''
52+
person[:name] = "#{first_name} #{last_name}".strip
53+
end
5154
end
5255
end

0 commit comments

Comments
 (0)