提交 cb8b4167 编写于 作者: Y Yasuo Honda

Replace drop sql statement to drop_table method

to drop sequences at the same time each tables dropped for Oracle
上级 a8eb6018
......@@ -18,8 +18,8 @@ class Child < ActiveRecord::Base
end
teardown do
@connection.execute("DROP TABLE parents") if @connection.table_exists? 'parents'
@connection.execute("DROP TABLE children") if @connection.table_exists? 'children'
@connection.drop_table 'parents' if @connection.table_exists? 'parents'
@connection.drop_table 'children' if @connection.table_exists? 'children'
end
test "belongs_to associations are not required by default" do
......
......@@ -28,7 +28,7 @@ def type_cast_from_user(value)
teardown do
return unless @connection
@connection.execute 'DROP TABLE attribute_decorators_model' if @connection.table_exists? 'attribute_decorators_model'
@connection.drop_table 'attribute_decorators_model' if @connection.table_exists? 'attribute_decorators_model'
Model.attribute_type_decorations.clear
Model.reset_column_information
end
......
......@@ -29,8 +29,8 @@ class Astronaut < ActiveRecord::Base
teardown do
if defined?(@connection)
@connection.execute "DROP TABLE astronauts" if @connection.table_exists? 'astronauts'
@connection.execute "DROP TABLE rockets" if @connection.table_exists? 'rockets'
@connection.drop_table "astronauts" if @connection.table_exists? 'astronauts'
@connection.drop_table "rockets" if @connection.table_exists? 'rockets'
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册