Skip to content

Commit

Permalink
Fix saving of people when clicking on them the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Feb 21, 2025
1 parent d950d40 commit a379c21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions app/domain/ptime/people_employees.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Ptime
class PeopleEmployees
ATTRIBUTES_MAPPING = { full_name: :name, shortname: :shortname, email: :email, marital_status:
:marital_status, graduation: :title, birthdate: :birthdate,
location: :location }.freeze
# Need to add 'city: :location & birthdate: :birthdate'
ATTRIBUTES_MAPPING = { firstname: :name, shortname: :shortname, email: :email, marital_status:
:marital_status, graduation: :title, location: :location }.freeze
def find_or_create(ptime_employee_id)
raise 'No ptime_employee_id provided' unless ptime_employee_id

Expand Down Expand Up @@ -39,6 +39,10 @@ def set_additional_attributes(person, ptime_employee)
ptime_employee_nationalities = ptime_employee[:attributes][:nationalities]
person.nationality = ptime_employee_nationalities[0]
person.nationality2 = ptime_employee_nationalities[1]

# temporary until the Ptime API gets updated
person.birthdate = DateTime.new(2000, 2, 3)
person.location = 'Boston, MA'
end
end
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

module Skills
def self.ptime_available?
%w[true True 1].include?(ENV.fetch('PTIME_API_ACCESSIBLE', false))
ActiveModel::Type::Boolean.new.cast(ENV.fetch('PTIME_API_ACCESSIBLE', true))
end

class Application < Rails::Application
Expand Down

0 comments on commit a379c21

Please sign in to comment.