Project

General

Profile

Patch #28939 » database.rb.patch

Pavel Rosický, 2018-06-04 00:30

View differences:

database.rb (working copy)
class << self
# Returns true if the database is PostgreSQL
def postgresql?
(ActiveRecord::Base.connection.adapter_name =~ /postgresql/i).present?
ActiveRecord::Base.connection.adapter_name.casecmp('postgresql') == 0
end
# Returns the PostgreSQL version or nil if another DBMS is used
......
# Returns true if the database is MySQL
def mysql?
(ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present?
ActiveRecord::Base.connection.adapter_name.casecmp('mysql') == 0
end
# Returns a SQL statement for case/accent (if possible) insensitive match
(1-1/2)