diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-02-15 21:14:17 +0000 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-03-02 20:29:32 +0000 |
commit | 53760bb836766973d3a3eb68d12782858b35adf3 (patch) | |
tree | a3207e33e938064504cd21f2e3aea2f86e8510c7 /lib | |
parent | 2429a109fd7df8ead9fdbbbb8b7b536e84a8aeb0 (diff) | |
download | gitlab-ce-53760bb836766973d3a3eb68d12782858b35adf3.tar.gz |
removes redundant code from gitlab database filegitlab-database-fix
Diffstat (limited to 'lib')
-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 |