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:
authorgfyoung <gfyoung17+gitlab@gmail.com>2018-10-22 10:00:50 +0300
committerRémy Coutable <remy@rymai.me>2018-10-22 10:00:50 +0300
commitc858f70d076dc44f6bf1ab1f7acb1fc13a12ab1b (patch)
tree40fa82826cf182f47b1c905e738c8ee955ad14c2 /lib/gitlab/database.rb
parent173b1436b1622b85d4a81e3577c6492cbb93a8b8 (diff)
Enable frozen string for lib/gitlab/*.rb
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r--lib/gitlab/database.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index 42f9605f5ac..68ed53cf64a 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Gitlab
module Database
# The max value of INTEGER type is the same between MySQL and PostgreSQL:
@@ -99,11 +101,11 @@ module Gitlab
order = "#{field} #{direction}"
if postgresql?
- order << ' NULLS LAST'
+ order = "#{order} NULLS LAST"
else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
# columns. In the (default) ascending order, `0` comes first.
- order.prepend("#{field} IS NULL, ") if direction == 'ASC'
+ order = "#{field} IS NULL, #{order}" if direction == 'ASC'
end
order
@@ -113,11 +115,11 @@ module Gitlab
order = "#{field} #{direction}"
if postgresql?
- order << ' NULLS FIRST'
+ order = "#{order} NULLS FIRST"
else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
# columns. In the (default) ascending order, `0` comes first.
- order.prepend("#{field} IS NULL, ") if direction == 'DESC'
+ order = "#{field} IS NULL, #{order}" if direction == 'DESC'
end
order
@@ -184,7 +186,7 @@ module Gitlab
EOF
if return_ids
- sql << 'RETURNING id'
+ sql = "#{sql}RETURNING id"
end
result = connection.execute(sql)