diff --git a/app/lib/url.rb b/app/lib/url.rb index 39ac4b654..5d4810572 100644 --- a/app/lib/url.rb +++ b/app/lib/url.rb @@ -5,11 +5,17 @@ module URL end def self.database_available? - ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?("site_configs") + ActiveRecord::Base.connected? && has_site_configs? end private_class_method :database_available? + def self.has_site_configs? + @has_site_configs ||= ActiveRecord::Base.connection.table_exists?("site_configs") + end + + private_class_method :has_site_configs? + def self.domain if database_available? Settings::General.app_domain