let migration_tools.attempt_money strip dollar signs for us
authorJason Etheridge <jason@esilibrary.com>
Wed, 14 Jan 2015 21:51:42 +0000 (21:51 +0000)
committerJason Etheridge <jason@esilibrary.com>
Wed, 14 Jan 2015 21:51:42 +0000 (21:51 +0000)
sql/base/base.sql

index c478f4b..610b741 100644 (file)
@@ -688,7 +688,7 @@ CREATE OR REPLACE FUNCTION migration_tools.attempt_money (TEXT,TEXT) RETURNS NUM
         output NUMERIC(8,2);
     BEGIN
         FOR output IN
-            EXECUTE 'SELECT ' || quote_literal(attempt_value) || '::NUMERIC(8,2) AS a;'
+            EXECUTE 'SELECT ' || quote_literal(REPLACE(attempt_value,'$','')) || '::NUMERIC(8,2) AS a;'
         LOOP
             RETURN output;
         END LOOP;