DEV: remove deprecated syntax

DEV: remove deprecated syntax

Ruby 2.7 is going to deprecate “Magic Proc Init”. This feature is enormously magical anyway and the new code is far easier to comprehend.

diff --git a/lib/mini_sql_multisite_connection.rb b/lib/mini_sql_multisite_connection.rb
index c08d3813a9..a1cd6a6897 100644
--- a/lib/mini_sql_multisite_connection.rb
+++ b/lib/mini_sql_multisite_connection.rb
@@ -26,8 +26,9 @@ class MiniSqlMultisiteConnection < MiniSql::Postgres::Connection
   end
 
   class AfterCommitWrapper
-    def initialize
-      @callback = Proc.new
+    def initialize(&blk)
+      raise ArgumentError, "tried to create a Proc without a block in AfterCommitWrapper" if !blk
+      @callback = blk
     end
 
     def committed!(*)

GitHub sha: b68eab2b

1 Like