From 71ea6a8328158f73c742e1d15774ec25ab5dd8eb Mon Sep 17 00:00:00 2001 From: markjcrane Date: Tue, 10 Nov 2015 17:04:42 -0700 Subject: [PATCH] Change the Database:query to make the fn optional which will make it more backwards compatible with current code. This fixes an issue with recent movement to the database class in call_forward.lua. --- resources/install/scripts/resources/functions/database.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/install/scripts/resources/functions/database.lua b/resources/install/scripts/resources/functions/database.lua index 89b5456193..f8939126ff 100644 --- a/resources/install/scripts/resources/functions/database.lua +++ b/resources/install/scripts/resources/functions/database.lua @@ -27,7 +27,11 @@ function Database.new(name) end function Database:query(sql, fn) - return self._dbh:query(sql, fn) + if (fn == nil) then + return self._dbh:query(sql) + else + return self._dbh:query(sql, fn) + end end function Database:first_row(sql)