From 8eb1e94f4d18a8e3d268392aa518b039dbc749c0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 30 Sep 2015 20:59:47 +0000 Subject: SQL error with MySQL (#19657). git-svn-id: http://svn.redmine.org/redmine/trunk@14633 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/database.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb index d8b4b7ccb..89a80129b 100644 --- a/lib/redmine/database.rb +++ b/lib/redmine/database.rb @@ -44,6 +44,11 @@ module Redmine end end + # Returns true if the database is MySQL + def mysql? + (ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present? + end + # Returns a SQL statement for case/accent (if possible) insensitive match def like(left, right, options={}) neg = (options[:match] == false ? 'NOT ' : '') -- cgit v1.2.3