From 6f4008950ed70321e03eed948eb4fe76f9ec9c96 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 4 Feb 2022 12:59:48 +0100 Subject: [PATCH] Qstr gen for UPDATE --- src/db_models.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/db_models.rb b/src/db_models.rb index 635559d..a1aafe5 100644 --- a/src/db_models.rb +++ b/src/db_models.rb @@ -4,7 +4,13 @@ class TableModel # Base model @table_name = table_name end - private def gen_update_query(vars, values) + private def gen_update_query(varhash, values) + qstr = "" + varhash.each do |val, var| + qstr += "#{var} = #{val}, " + end + + return qstr end private def get(attr, filter="")