diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-03-06 16:13:11 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-03-06 16:13:11 +0000 |
commit | 0a58a8c8258d26e7f5c782ca1cce8665d230fa83 (patch) | |
tree | ffe0abc080d8af351b896c45a787d205b6cca142 | |
parent | eb7b03af2c8fe759c6e1e94222a19413ff5f21bf (diff) | |
parent | 53760bb836766973d3a3eb68d12782858b35adf3 (diff) | |
download | gitlab-ce-0a58a8c8258d26e7f5c782ca1cce8665d230fa83.tar.gz |
Merge branch 'gitlab-database-fix' into 'master'
removes redundant code from gitlab database file
See merge request !9282
-rw-r--r-- | lib/gitlab/database.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index d160cadc2d0..f3f417c1a63 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -24,7 +24,7 @@ module Gitlab def self.nulls_last_order(field, direction = 'ASC') order = "#{field} #{direction}" - if Gitlab::Database.postgresql? + if postgresql? order << ' NULLS LAST' else # `field IS NULL` will be `0` for non-NULL columns and `1` for NULL @@ -38,7 +38,7 @@ module Gitlab def self.nulls_first_order(field, direction = 'ASC') order = "#{field} #{direction}" - if Gitlab::Database.postgresql? + if postgresql? order << ' NULLS FIRST' else # `field IS NULL` will be `0` for non-NULL columns and `1` for NULL @@ -50,7 +50,7 @@ module Gitlab end def self.random - Gitlab::Database.postgresql? ? "RANDOM()" : "RAND()" + postgresql? ? "RANDOM()" : "RAND()" end def true_value |