Skip to content

Commit

Permalink
ds muäs so
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jul 29, 2024
1 parent 5411381 commit af3def7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/person_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def sorted_people

def fetch_ptime_or_skills_data
all_skills_people = Person.all.map { |p| [p.name, person_path(p)] }
return all_skills_people unless ptime_available?
return all_skills_people unless Skills.ptime_available?

ptime_employees = Ptime::Client.new.request(:get, 'employees', { per_page: 1000 })
build_dropdown_data(ptime_employees)
Expand Down
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
Bundler.require(*Rails.groups)

module Skills
def self.ptime_available?
ActiveModel::Type::Boolean.new.cast(ENV.fetch('PTIME_API_ACCESSIBLE', true))
end

class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
Expand Down

0 comments on commit af3def7

Please sign in to comment.