Make use of ENV.fetch
This commit is contained in:
parent
200d188af2
commit
36b23ce25d
27 changed files with 51 additions and 53 deletions
|
|
@ -5,7 +5,7 @@ Osem::Application.routes.draw do
|
|||
get '/', to: 'conferences#show'
|
||||
end
|
||||
|
||||
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true'
|
||||
devise_for :users, controllers: { registrations: :registrations }
|
||||
else
|
||||
devise_for :users,
|
||||
|
|
@ -225,8 +225,8 @@ Osem::Application.routes.draw do
|
|||
|
||||
get '/calendar' => 'conferences#calendar'
|
||||
|
||||
unless ENV['OSEM_ROOT_CONFERENCE'].blank?
|
||||
root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}")
|
||||
if ENV.fetch('OSEM_ROOT_CONFERENCE', nil)
|
||||
root to: redirect("/conferences/#{ENV.fetch('OSEM_ROOT_CONFERENCE')}")
|
||||
else
|
||||
root to: 'conferences#index', via: [:get, :options]
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue