From 9aeb9df26f24a8c5779fdb835ce2dbafef0365f4 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 21 Jun 2018 12:23:50 +1000 Subject: [PATCH] move to new db exec pattern --- plugin.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index cb3d809..27d56e1 100644 --- a/plugin.rb +++ b/plugin.rb @@ -44,7 +44,12 @@ after_initialize do p.user_id IS NOT NULL SQL - UserAction.exec_sql(sql, solved: UserAction::SOLVED) + # TODO post discourse 2.1 remove + if defined? DB + DB.exec(sql, solved: UserAction::SOLVED) + else + UserAction.exec_sql(sql, solved: UserAction::SOLVED) + end end $redis.set("solved_already_upgraded", "true") end