From 9c7df62c3f4cff321a7b393b541b2272f04764aa Mon Sep 17 00:00:00 2001 From: Jurre Stender Date: Thu, 21 Dec 2023 09:33:06 +0100 Subject: [PATCH] Enable gaplock protection when using trilogy mysql adapter In https://github.com/gocardless/statesman/pull/522 the ability to enable gaplock protection manually was removed, likely assuming there was no need for this since it's enabled by default when using an adapter that is named `mysql*`, however we use https://github.com/trilogy-libraries/trilogy which has been gaining some traction in the community and this change now leaves us without a way to enable the functionality. I think it makes most sense to enable the functionality by default when using this new adapter as well, and keep config requirements minimal, so I added a little check for that adapter name as well. --- lib/statesman/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/statesman/config.rb b/lib/statesman/config.rb index e493e10e..beaea8cb 100644 --- a/lib/statesman/config.rb +++ b/lib/statesman/config.rb @@ -27,7 +27,7 @@ def mysql_adapter?(adapter_class) adapter_name = adapter_name(adapter_class) return false unless adapter_name - adapter_name.downcase.start_with?("mysql") + adapter_name.downcase.start_with?("mysql", "trilogy") end def adapter_name(adapter_class)