Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarka Kadlecová <jarka@gitlab.com>2018-06-05 12:29:33 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-06-14 09:39:43 +0300
commitfa36101a7fc8679d98198942f15dd6285673594d (patch)
tree75d233d7910354ef47511de29929800fb35cb4ad /lib/gitlab/database.rb
parent760b12dc6b3a927c918855e2ee85a1c0e6bddb73 (diff)
Use data_source_exists? instead of table_exists?
Use data_source_exists? where possible instead of table_exists? in order to be Rails5 compatible
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r--lib/gitlab/database.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index d49d055c3f2..4ad106e7b0a 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -188,8 +188,11 @@ module Gitlab
end
def self.cached_table_exists?(table_name)
- # Rails 5 uses data_source_exists? instead of table_exists?
- connection.schema_cache.table_exists?(table_name)
+ if Gitlab.rails5?
+ connection.schema_cache.data_source_exists?(table_name)
+ else
+ connection.schema_cache.table_exists?(table_name)
+ end
end
private_class_method :connection