Skip to content

Commit

Permalink
Move ptime connection to concerns and rename it to people_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Jul 31, 2024
1 parent b9c7959 commit 3874b7c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Ptime
module PtimeConnection
module PeopleController
def show
return export if format_odt?

Expand Down
2 changes: 1 addition & 1 deletion app/domain/ptime/people_employees.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def update_person_data(person)
raise 'Person has no ptime_employee_id' unless person.ptime_employee_id

ptime_employee = Ptime::Client.new.request(:get, "employees/#{person.ptime_employee_id}")
rescue CustomExceptions::PTimeTemporarlyUnavailableError
rescue CustomExceptions::PTimeTemporarilyUnavailableError
nil
else
ptime_employee[:attributes].each do |key, value|
Expand Down
1 change: 1 addition & 0 deletions app/exceptions/custom_exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module CustomExceptions

class PTimeClientError < StandardError; end
class PTimeTemporarilyUnavailableError < StandardError; end

end
3 changes: 3 additions & 0 deletions config/initializers/ptime.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rails.application.config.to_prepare do
PeopleController.include Ptime::PeopleController if Skills.ptime_available?
end
1 change: 0 additions & 1 deletion config/initializers/ptime_connector.rb

This file was deleted.

0 comments on commit 3874b7c

Please sign in to comment.