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