Removed unnecessary config params. Improved error handling.
This commit is contained in:
parent
61a87dacb6
commit
18e8a11b7d
4 changed files with 17 additions and 14 deletions
|
|
@ -140,10 +140,15 @@ class ApplicationController < ActionController::Base
|
|||
def select_foodcoop
|
||||
if Foodsoft.config[:multi_coop_install]
|
||||
if !params[:foodcoop].blank?
|
||||
# Set Config
|
||||
Foodsoft.env = params[:foodcoop]
|
||||
# Set database-connection
|
||||
ActiveRecord::Base.establish_connection(Foodsoft.database)
|
||||
begin
|
||||
# Set Config
|
||||
Foodsoft.env = params[:foodcoop]
|
||||
# Set database-connection
|
||||
ActiveRecord::Base.establish_connection(Foodsoft.database)
|
||||
rescue => error
|
||||
flash[:error] = error.to_s
|
||||
redirect_to root_path
|
||||
end
|
||||
else
|
||||
redirect_to root_path
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue