diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-17 11:51:22 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-25 12:21:38 +0800 |
commit | 2b3d00a77822eaf2e622dd0b1baf85ebea2b1ee4 (patch) | |
tree | 4444788d3f059ea8fa970dadcc777a72a00bcb04 /config/initializers | |
parent | 046c85ed603f8fb581b1be71a5de5525e24a5fbb (diff) | |
download | gitlab-ce-2b3d00a77822eaf2e622dd0b1baf85ebea2b1ee4.tar.gz |
Remove unneeded monkey-patch54478-table_exists-not-compatible-with-rails-5-1
Changes all calls to data_source_exists? to table_exists?
since that is the intent of these calls
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/0_license.rb | 2 | ||||
-rw-r--r-- | config/initializers/active_record_migration.rb | 10 | ||||
-rw-r--r-- | config/initializers/load_balancing.rb | 2 |
3 files changed, 2 insertions, 12 deletions
diff --git a/config/initializers/0_license.rb b/config/initializers/0_license.rb index f750022dfdf..19c71c34904 100644 --- a/config/initializers/0_license.rb +++ b/config/initializers/0_license.rb @@ -10,7 +10,7 @@ Gitlab.ee do end # Needed to run migration - if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.data_source_exists?('licenses') + if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses') message = LicenseHelper.license_message(signed_in: true, is_admin: true, in_html: false) if ::License.block_changes? && message.present? warn "WARNING: #{message}" diff --git a/config/initializers/active_record_migration.rb b/config/initializers/active_record_migration.rb deleted file mode 100644 index 04c06be7834..00000000000 --- a/config/initializers/active_record_migration.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'active_record/migration' - -module ActiveRecord - class Migration - # data_source_exists? is not available in 4.2.10, table_exists deprecated in 5.0 - def table_exists?(table_name) - ActiveRecord::Base.connection.data_source_exists?(table_name) - end - end -end diff --git a/config/initializers/load_balancing.rb b/config/initializers/load_balancing.rb index 029c0ff4277..a49bcbe1f96 100644 --- a/config/initializers/load_balancing.rb +++ b/config/initializers/load_balancing.rb @@ -3,7 +3,7 @@ # We need to run this initializer after migrations are done so it doesn't fail on CI Gitlab.ee do - if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.data_source_exists?('licenses') + if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses') if Gitlab::Database::LoadBalancing.enable? Gitlab::Database.disable_prepared_statements |