Patch #28939 » database.rb.patch
database.rb (working copy) | ||
---|---|---|
21 | 21 |
class << self |
22 | 22 |
# Returns true if the database is PostgreSQL |
23 | 23 |
def postgresql? |
24 |
(ActiveRecord::Base.connection.adapter_name =~ /postgresql/i).present?
|
|
24 |
ActiveRecord::Base.connection.adapter_name.casecmp('postgresql') == 0
|
|
25 | 25 |
end |
26 | 26 | |
27 | 27 |
# Returns the PostgreSQL version or nil if another DBMS is used |
... | ... | |
46 | 46 | |
47 | 47 |
# Returns true if the database is MySQL |
48 | 48 |
def mysql? |
49 |
(ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present?
|
|
49 |
ActiveRecord::Base.connection.adapter_name.casecmp('mysql') == 0
|
|
50 | 50 |
end |
51 | 51 | |
52 | 52 |
# Returns a SQL statement for case/accent (if possible) insensitive match |