date_add for mysql correction

This commit is contained in:
ms32035 2014-03-11 23:05:10 +01:00
parent b0d64c4735
commit 3d33881897

View file

@ -3,7 +3,7 @@ module RDBMSFunctions
adapter_type = connection.adapter_name.downcase.to_sym
case adapter_type
when :mysql
"DATE_ADD(`#{source}`, INTERVAL #{unit} #{AMOUNT})"
"DATE_ADD(`#{source}`, INTERVAL #{amount} #{unit})"
when :postgresql
"(#{source} + INTERVAL '#{amount} #{unit}')"
else