diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-15 22:50:31 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-15 22:51:39 +0300 |
commit | 4acbc9410d2d3f5624ebf9cf8850b189524d321d (patch) | |
tree | 476bdf735bd27b7cc0ff0c837851e257d0c420e7 /app/models/application_setting.rb | |
parent | ff292d40a23e3df9b08f7b4dc715f1e35bf34de1 (diff) |
Cache column_exists? for application settings
This is most a backport of
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4987/diffs but includes
other columns that use column_exists? in a way that may cause unnecessary
schema loads.
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 0dee6df525d..3cbbf8b5dfa 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -347,15 +347,15 @@ class ApplicationSetting < ActiveRecord::Base end def home_page_url_column_exists? - ActiveRecord::Base.connection.column_exists?(:application_settings, :home_page_url) + ::Gitlab::Database.cached_column_exists?(:application_settings, :home_page_url) end def help_page_support_url_column_exists? - ActiveRecord::Base.connection.column_exists?(:application_settings, :help_page_support_url) + ::Gitlab::Database.cached_column_exists?(:application_settings, :help_page_support_url) end def sidekiq_throttling_column_exists? - ActiveRecord::Base.connection.column_exists?(:application_settings, :sidekiq_throttling_enabled) + ::Gitlab::Database.cached_column_exists?(:application_settings, :sidekiq_throttling_enabled) end def domain_whitelist_raw |