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:
Diffstat (limited to 'lib/gitlab/database/postgres_foreign_key.rb')
-rw-r--r--lib/gitlab/database/postgres_foreign_key.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/database/postgres_foreign_key.rb b/lib/gitlab/database/postgres_foreign_key.rb
index bb3e1d45f15..9fb3098efe0 100644
--- a/lib/gitlab/database/postgres_foreign_key.rb
+++ b/lib/gitlab/database/postgres_foreign_key.rb
@@ -21,7 +21,7 @@ module Gitlab
enum on_update_action: ACTION_TYPES, _prefix: :on_update
scope :by_referenced_table_identifier, ->(identifier) do
- unless identifier =~ Database::FULLY_QUALIFIED_IDENTIFIER
+ unless Database::FULLY_QUALIFIED_IDENTIFIER.match?(identifier)
raise ArgumentError, "Referenced table name is not fully qualified with a schema: #{identifier}"
end
@@ -31,7 +31,7 @@ module Gitlab
scope :by_referenced_table_name, ->(name) { where(referenced_table_name: name) }
scope :by_constrained_table_identifier, ->(identifier) do
- unless identifier =~ Database::FULLY_QUALIFIED_IDENTIFIER
+ unless Database::FULLY_QUALIFIED_IDENTIFIER.match?(identifier)
raise ArgumentError, "Constrained table name is not fully qualified with a schema: #{identifier}"
end
@@ -41,7 +41,7 @@ module Gitlab
scope :by_constrained_table_name, ->(name) { where(constrained_table_name: name) }
scope :by_constrained_table_name_or_identifier, ->(name) do
- if name =~ Database::FULLY_QUALIFIED_IDENTIFIER
+ if Database::FULLY_QUALIFIED_IDENTIFIER.match?(name)
by_constrained_table_identifier(name)
else
by_constrained_table_name(name)