Commit 0a58a8c8 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'gitlab-database-fix' into 'master'

removes redundant code from gitlab database file

See merge request !9282
parents eb7b03af 53760bb8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment