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.rb8
1 files changed, 8 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..0107babaaf
--- /dev/null
+++ b/activerecord/test/support/ddl_helper.rb
@@ -0,0 +1,8 @@
+module DdlHelper
+ def with_example_table(connection, table_name, definition = nil)
+ connection.exec_query("CREATE TABLE #{table_name}(#{definition})")
+ yield
+ ensure
+ connection.exec_query("DROP TABLE #{table_name}")
+ end
+end