Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001

This commit is contained in:
phyusin
2018-04-23 14:42:43 +06:30
41 changed files with 437 additions and 197 deletions

View File

@@ -12,7 +12,7 @@ class ActionController::Base
ActiveRecord::Base.establish_connection(website_connection(@license))
# authenticate_session_token
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
else8
else
# reconnect_default_db
logger.info 'License is nil'
# redirect_to root_url(:host => request.domain) + "store_error"
@@ -50,6 +50,16 @@ class ActionController::Base
end
end
def check_license
License.check_license_file
end
def check_installation
if current_company.nil?
redirect_to install_path
end
end
def website_connection(license)
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
:username => license.dbusername, :password => license.dbpassword)