Merge pull request #479 from foodcoop1040/default_scope

Fall back to default_scope if an invalid foodcoop is provided
This commit is contained in:
wvengen 2017-07-12 20:47:24 +02:00 committed by GitHub
commit 03256d28dd

View file

@ -172,6 +172,7 @@ class ApplicationController < ActionController::Base
# Set Config and database connection # Set Config and database connection
FoodsoftConfig.select_foodcoop params[:foodcoop] FoodsoftConfig.select_foodcoop params[:foodcoop]
rescue => error rescue => error
FoodsoftConfig.select_foodcoop FoodsoftConfig.config[:default_scope]
redirect_to root_url, alert: error.message redirect_to root_url, alert: error.message
end end
else else