OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix connection being memoized in sqlbypass class
Oliver Güntheraeec219bfbe4
diff --git a/app/models/sessions/sql_bypass.rb b/app/models/sessions/sql_bypass.rbindex 4bffa392947..6f7f1a8c7e7 100644--- a/app/models/sessions/sql_bypass.rb+++ b/app/models/sessions/sql_bypass.rb@@ -57,17 +57,19 @@ module Sessionsendend- ##- # Ensure we're not memoizing the connection- def connection- ::ActiveRecord::Base.connection- end-def connection_pool::ActiveRecord::Base.connection_poolend++ def connection+ ::ActiveRecord::Base.connection+ endend+ # Ensure we use our own class methods for delegation of the connection+ # otherwise the memoized superclass is being used+ delegate :connection, :connection_pool, to: :class+### Save while updating the user_id reference and updated_at columndef save@@ -107,6 +109,7 @@ module SessionsSQLend+def update!connection.update <<~SQL, 'Update session'UPDATE sessions