aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support/ddl_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/support/ddl_helper.rb')
-rw-r--r--activerecord/test/support/ddl_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/support/ddl_helper.rb b/activerecord/test/support/ddl_helper.rb
new file mode 100644
index 0000000000..a18bf5ea0a
--- /dev/null
+++ b/activerecord/test/support/ddl_helper.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module DdlHelper
+ def with_example_table(connection, table_name, definition = nil)
+ connection.execute("CREATE TABLE #{table_name}(#{definition})")
+ yield
+ ensure
+ connection.execute("DROP TABLE #{table_name}")
+ end
+end