date_add for mysql correction

ms32035 11 年之前
父節點
當前提交
3d33881897
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/rdbms_functions.rb

+ 1 - 1
lib/rdbms_functions.rb

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