Simplify self host settings controller (#1230)

This commit is contained in:
Zach Gollwitzer
2024-10-02 12:07:56 -04:00
committed by GitHub
parent cb75c537fe
commit 7fabca4679
22 changed files with 252 additions and 399 deletions

View File

@@ -18,13 +18,12 @@ module Providable
Provider::Github.new
end
def synth_provider
api_key = self_hosted? ? Setting.synth_api_key : ENV["SYNTH_API_KEY"]
api_key.present? ? Provider::Synth.new(api_key) : nil
end
private
def synth_provider
api_key = self_hosted? ? Setting.synth_api_key : ENV["SYNTH_API_KEY"]
api_key.present? ? Provider::Synth.new(api_key) : nil
end
def self_hosted?
Rails.application.config.app_mode.self_hosted?
end