Skip to content

Commit

Permalink
Outsource the appending of the name to make rubocop happy :)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Feb 21, 2025
1 parent 261a473 commit 50f19be
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/domain/ptime/people_employees.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def update_person_data(person)
end
end
set_additional_attributes(person, ptime_employee)
set_full_name(person, ptime_employee)
person.save!
person
end
Expand All @@ -40,13 +41,15 @@ def set_additional_attributes(person, ptime_employee)
person.nationality = ptime_employee_nationalities[0]
person.nationality2 = ptime_employee_nationalities[1]

first_name = ptime_employee[:attributes][:firstname].presence || ''
last_name = ptime_employee[:attributes][:lastname].presence || ''
person[:name] = "#{first_name} #{last_name}".strip

# temporary until the Ptime API gets updated
person.birthdate = DateTime.new(2000, 2, 3)
person.location = 'Boston, MA'
end

def set_full_name(person, ptime_employee)
first_name = ptime_employee[:attributes][:firstname].presence || ''
last_name = ptime_employee[:attributes][:lastname].presence || ''
person[:name] = "#{first_name} #{last_name}".strip
end
end
end

0 comments on commit 50f19be

Please sign in to comment.