Make use of ENV.fetch
This commit is contained in:
parent
200d188af2
commit
36b23ce25d
27 changed files with 51 additions and 53 deletions
|
|
@ -116,7 +116,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def sign_in_path
|
||||
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true'
|
||||
new_user_ichain_session_path
|
||||
else
|
||||
new_user_session_path
|
||||
|
|
@ -140,9 +140,7 @@ module ApplicationHelper
|
|||
|
||||
def nav_root_link_for(conference)
|
||||
link_text = (
|
||||
conference.try(:organization).try(:name) ||
|
||||
ENV['OSEM_NAME'] ||
|
||||
'OSEM'
|
||||
conference.try(:organization).try(:name) || ENV.fetch('OSEM_NAME', 'OSEM')
|
||||
)
|
||||
link_to(
|
||||
link_text,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ module UsersHelper
|
|||
unless Rails.application.secrets.send(provider_key).blank? || Rails.application.secrets.send(provider_secret).blank?
|
||||
providers << provider
|
||||
end
|
||||
providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank?
|
||||
providers << provider if ENV.fetch("OSEM_#{provider.upcase}_KEY", nil).present? && ENV.fetch("OSEM_#{provider.upcase}_SECRET", nil).present?
|
||||
end
|
||||
|
||||
providers.uniq
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue